10-07-2010 12:47 AM
Hi,
I am new to LabVIEW...
I have a binary 2D array and I would like to save it to .bmp file. The .bmp file has to be 1-bit bit depth in order to meet the devide requriement.
I tried to use flatten pixmap but it only has 4-, 8-, 24-bit pixmap options for 2D array. 1-bit pixmap is for the boolean array input.
I don't know how to convert the binary 2D array into the boolean array or any other method to fix this problem.
I appreciate ya'll's help.
Thanks,
Jinyang
Solved! Go to Solution.
10-07-2010 01:56 AM
10-07-2010 03:18 PM
Thanks! It works really well now!!
But now I have got another problem. Since the bit depth is only 1, I can only enter 2 color element for display. So, I tried 0 and 1 but it didn't show up very well. Then, I tried some larger number like 127 or 255 and it display as black (0) and blue (255).
I wonder if there is a way to display the .bmp binary file on only black and white color.
Thanks,
Jinyang
10-08-2010 01:02 AM - edited 10-08-2010 01:03 AM
Hi Jinyang,
you have to give real color values...
Until now you only gave the index of the color (0 and 1), but colors itself are given in RGB values. Either use the color constant (found nearby the picture file functions) or a standard U32 constant (switched to hex display). Then set your colors. When using an U32 you have to give the value of each color component. Red is 0x00FF0000, green=0x0000FF00, blue=0x000000FF, white=0x00FFFFFF, black=0x00000000. Do you get the scheme?
10-11-2010 12:15 PM
Great! It works really well!! Thank you so much!!