Hi.
I am developing an application to capture images using the NI-IMAQ for IEEE 1394 Camera API. I am using Microsoft Visual Studio (C++) 7.1 on Windows XP.
I call imaq1394Snap() passing it a valid session id, previously allocated buffer, and Rect object. Here is the buffer:
unsigned char *buffer;
buffer=new unsigned char[bufferSize];
The buffer I get is valid and contains the correct data for the image captured. (I tested this out with other software and was able to view the image data.)
The problem arises when I try to save the buffer as a .tif image with the imaq1394SaveBuffer() method.
int rval=imaq1394SaveBuffer(sid, buffer, "image.tif");
The method seems to work and rval==IMG1394_ERR_GOOD. However, the resulting .tif file is not valid; it won't open and is only 1KB. I also tried to save as .bmp, .jpg, and .png files, but these did not work (bmp and jpg do not save, png crashes the program). What is the right way to save a buffer as a .tif image?
Thanks in advance for any help or advice!