Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load image from memory instead of Harddisk (.NET)

Hi,
 
How can I load an image from memory into IMAQ format picture, not using the Harddisk.?
 
At this moment I save my picture (.bmp) to the harddisk and then open again via CWIMAQVision1.ReadImage(...)
As this is the only way I can make it work.
 
But this is not what I want. I would like to convert directly from RAM towards IMAQ compatible format.
 
All the examples I saw where using functions that use an actual pathname to harddisk.
 
Thanks,
Tom.
 
Message 1 of 5
(4,027 Views)
It depends.  The image in RAM in what form?  Do you have a handle of it?

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 2 of 5
(4,018 Views)

If you have purchased the Vision toolkit, you can use IMAQ ArrayToImage.  The input is a 2D array of pixel intensities, and the output is an IMAQ image.

Without the toolkit, I don't think there is a way to bring in images from other sources.

Bruce

Bruce Ammons
Ammons Engineering
Message 3 of 5
(4,002 Views)

Thanks,

I'll try the arraytoimage functionality.
I think we have the toolkit, but I'm not sure.

It's a .bmp format and yes I have a handle.
I try to cast it, but that didn't do the trick.

 

Many thanks,

Tom.

 

 

0 Kudos
Message 4 of 5
(3,982 Views)
If you got the handle, you got the image.
To get pixels, you got to use Window API.
There is a VI on my website does this: Bitmap handle to Image Cluster

George Zou
http://gtoolbox.yeah.net
George Zou
0 Kudos
Message 5 of 5
(3,966 Views)