01-07-2009 06:32 PM
Hi,
I'm trying to use a 3rd party API to pass an image to, which has been opened by NI vision. The third party app expects a pointer in memory to the image (also resolution, dpi etc). My question is, can I just typecast the image reference to the integer the API expects, and get the resulting memory pointer? Or is the pointer embedded in the information pointed to by the image reference? How would I get at the address pointer?
Thanks
01-08-2009 12:00 AM
01-08-2009 01:07 AM
01-08-2009 05:24 PM
03-16-2009 06:38 PM
Hi,
I'm running into another problem regarding this. The API I am using requires not only the pointer to the image, but the resolution in Dots Per Inch. I have been working with a standalone vi to test out the 3rd party API, using an image loading from disk with NI tools (IMAQ create then IMAQ readfile). To get the DPI, I have been using IMAQ GetImageInfo, which outputs the "units" (as in inches, cm etc), X step, and Y step. I took those outputs, did some math, and converted to DPI. It has been working great. However, when recently trying to pass an image which has been "grabbed" from the camera, the IMAQ GetImageInfo returns an "undefined" for the unit, and "1.0000" for both X and Y step.
One difference I can think of between the images loaded off of disk, and a grabbed one using IMAQ grab, is that I acquired my test images on disk using IMAX, then loaded cropped and saved them using an image editor.
My question is, does IMAQ GetImageInfo calculate X step and Y step, and units (and how does it determine units?), or does it rely on this information to be embedded as data in the image? Maybe my image editors saved this information to the image itself during a save? How can I get an image output from IMAQ grab to return units, X step and Y step using IMAQ GetImageInfo?
Thanks
David