Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I save the 12-bits gray scale image ?

Software & Hardware
NI-IMAQ Vision 6.0
NI-IMAQ for 1394 2.0.0
Hamamatsu C4742-95
 
I acqured the 12-bits gray scale image (Format7 , 640X512 size , 12bits) successfully.
And CWIMAQViewer display the correct image of which the range is from 0(black) to 4096(white).
But, I don't find the way to save this image with 12-bits format T.T
Always, CWIMAQVision object save this image to 8-bit format.
I tested all formats - tiff, bmp, aip, png.
 
I think there are two possible problems.
1. I dont't know the way to save the 12bits gray scale image. :{
2. I dont't know the way to read the 12bits gray scale image that saved correctly. 🙂
 
How can I save and load the 12-bits gray scale image ?
What is the solution for this problem T.T ?
 
 
0 Kudos
Message 1 of 2
(5,984 Views)
Hello,
 
I would recommend taking a look at the "ReadImage" Visual Basic project for more information on setting the image type and saving the image to file.  When you run the program, make sure you select 16 bit for your image.  You can also add another button to this example for saving the image.  Within the click subroutine for the button, you can add the line:
CWIMAQVision1.WritePNGFile CWIMAQViewer1.Image, "C://image.png"
This method will save the image in the viewer as a png file.  As long as it was loaded as a 16 bit image, it should save all of the 12 bit information into the file.  You could then test the new image by loading it using the example (you can see the pixel values by right-clicking on the viewer and selecting Settings>>Show Image Info.  The pixel value displayed in the info bar corresponds to the mouse position.
 
Best Regards,
 
Jesse D.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(5,975 Views)