**Note the camera must have been connected before any of these will work** cPix logs the various commands to c:\cpixscript.log to aid with debugging List of functions :- -- snapshot Take a picture usage: snapshot(); -- getlast Downloads the last picture taken to the preset directory usage: getlast(); -- zoom( mm ) Sets the zoom in mm from (nn)mm to 23.4mm usage: zoom( 13.4 ); -- countphotos returns the number of photos stored on the camera usage: count = countphotos(); -- photosleft returns the approximate number of photos left in the camera ( in current resolution ) usage: count = photosleft() ; -- memoryleft returns the amount of memory in bytes that are free on the card usage: bytes = memoryleft(); -- setexposure sets the exposure time usage: setexposure( 1000 ); -- getexposure gets the exposure time usage: n = getexposure( ); -- setdownloaddir( path ) sets the download directory to save the images too usage: setdownloaddir("c:\"); -- setaperture sets the aperture mode AP_Auto = 0 AP_Low = 1 AP_Medium = 2 AP_Unknown = 3 AP_High= 4 usage: setaperture( AP_Auto ); -- setshutteradj sets the shutter adjustment ( ev comp i think ) 0 - nnnnnn usage: setshutteradj( 1000 ); -- setresolution sets the resolution to use VGA_Basic =1 VGA_Normal =2 VGA_Fine =3 SXGA_Basic =4 #1 SXGA_Normal =5 #1 SXGA_Fine =6 #1 XGA_Basic =7 XGA_Normal =8 XGA_Fine =9 UXGA_Basic =10 #1 UXGA_Normal =11 #1 UXGA_Fine =12 #1 R3_2_Basic =14 #2 R3_2_Normal =15 #2 R3_2_Fine =16 #2 R3_2_Hi =34 #2 Basic =17 Normal =18 Fine =19 Hi =35 Note all cameras support all modes #1 995 only #2 Not available on 950 usage: setresolution( R3_2_Normal ); -- currentframe returns the curent frame(image) number usage: frame = currentframe(); -- setcolourmode sets the colour mode CM_Colour CM_BW usage: setcolourmode(CM_Colour); -- setwhitebalance Sets the white balance mode WB_Auto WB_Sunny WB_Incandescent WB_Fluorescent WB_Unknown WB_Flash WB_Preset usage: setwhitebalance( WB_Flash ); -- setimageadjust sets the image adjustment mode IA_Normal IA_More_Contrast IA_Less_Contrast IA_Lighten_Image IA_Darken_Image IA_Auto usage: setimageadjust( IA_Less_Contrast); -- setfocusmode( mode ) sets the focus mode MA_Unknown MA_Macro MA_Normal MA_Infinity usage: setfocusmode( MA_Macro ); -- setflashmode( mode ) Sets the flash mode FL_Auto FL_On FL_Off FL_RedEye FL_Slow usage: setflashmode( FL_RedEye ); -- getsavetime Returns the last time reading from the camera in ms usage: n = getsavetime(); -- getzoom Returns the zoom * 10 so 11.4mm would be 114 usage: n = getzoom(); -- getbatterylevel Returns the battery level usage: n = getbatterylevel(); -- deletelast deletes the last image taken. usage: deletelast(); -- deleteall deletes all the images! warning this just deletes all the images, its upto you to decide if its the right thing to do ! usage: deleteall(); -- uploadtoftp uploads a file by name to the predefined ftp site, works exactly as it does in timelapse mode. (the file will be renamed to webcam.jpg unless told otherwise) usage: uploadtoftp([[filename.jpg]]); -- getcurrentfilename returns the filename of the current frame string will be all 0's if no name available. usage: n = getcurrentfilename(); -- usecamerafilename call this to toggle between using the cameras given filename or the filename specified in the FTP settings ( default webcam.pix ) usage: use predefined name from FTP settings for upload name usecamerafilename( 0 ) ; use name from camera for upload name usecamerafilename( 1 ) ; --- messageboxes() Turns the warning boxes on and off, used for time lapse etc, in case there is a error message during a long session, it sends to the log file instead. usage: sets messages to display messageboxes(0) sets messages to log only messageboxes(1) --- gaussianblur(file,max delta, radius) Performs a gaussian blur on an image file usage: gaussianblur([[DSCN001.jpg]], 50, 0.3 ) --- loadpic( file ) Loads a picture and returns the data ptr to it, picture type can be, jpg, png, pnm tiff or bmp/wbmp (it determines by the extension) usage: n = loadpic( [[DSCN0001.jpg ]] ) ; --- savepic( file, data ) Saves a picture to the type specified by the extension type, uses data from data ptr, picture type can be, jpg, png, pnm tiff or bmp/wbmp (it determines by the extension) usage: (will load a jpeg and save it as a bmp) n = loadpic( [[DSCN0001.jpg ]] ) ; savepic([[fred.bmp]],n) ; freepic( n ) -- freepic( data ) Call this after you have finished with a picture, pass in the value returned from loadpic usage: n = loadpic( [[DSCN0001.jpg ]] ) ; freepic( n ) ; ---------------------------------------------------------------- Examples: -------- Simple program Switches message boxes off Sets the zoom, to 14mm Sets the image download directory to c:\myphotos Sets the cameras image capture mode to black and white Takes a picture. Then gets the filename of the image Finally uploads it to the predefined FTP site messageboxes(1) zoom( 14 ); setdownloaddir("C:\myphotos"); setcolourmode( CM_BW ); snapshot(); n = [[""]]; n = getcurrentfilename(); uploadtoftp( n ); -------- Lets get a little more into it. setupcamera() { zoom( 14) ; setcolourmode( CW_COLOUR ); setwhitebalance( WB_Auto ); setresolution( 3_2_Normal ); }