12-09-2009 04:13 PM - edited 12-09-2009 04:13 PM
I am developing an app using VB 2005 that measures either 16-bit or 8-bit image files. When I read the image, I am finding that I must set the image type of the image buffer before reading the image into it. For example, if I read a 16-bit image into an 8-bit buffer the image is truncated. I suppose I could read the image into an 16-bit buffer and re-type it if pixel values are less than 255.
Is there a better way to do this? Can I determine the bit depth of an image before loading it into a buffer?
Thanks!
Solved! Go to Solution.
12-11-2009 04:50 PM
Hi Steverino,
For you to be able to determine the bit depth of an image, it has to be loaded first
12-12-2009 02:55 AM
Hi Steverino,
Olivia is incorrect.... VDM has a function called GetFileInfo that does just what you want. This only reads the header of the image but does not load the entire image into memory. It will give you various properties such as the bit depth.
I believe on the new .NET support it might exist here: NationalInstruments.Vision.Analysis.Algorithms.GetFileInformation.
Through CVI and our legacy .NET support it is likely a similar name.
Eric