08-19-2009 01:15 PM
I currently grabbing an image, using my own hardware and windows messaging, and have it in memory as a bitmap image. How do I copy this image to an IMAQ Vision Image structure. I see from other threads that the structure is proprietary, but is there a way to copy the raw data into the Image structure. The only way I can achieve this is to write to a BMP file, then use the imaqReadFile () to read it back in. This takes a lot of time, it would be much quicker if I could copy from one memory location to another.
Solved! Go to Solution.
08-20-2009 01:45 AM
you may use imaqArrayToImage() but i always found this function awkward to use.
my preferred way is to create a new image of the right size using imaqCreateImage(), then obtain a pointer to its first pixel using imaqGetImageInfo() and fill the pixels directly by copying the data into the image buffer. i already showed how to access pixels directly on this forum. you should pay attention to the size of your pixels and the image format (grayscale, rgb).