09-18-2006 06:58 PM
SavePanelDisplayToFile() Function is working OK but saved .PNG file is not in 256 color resolution.
How is the process of changing the setting of the color resolution to 24 to 256.
Thank you for the Help.
09-19-2006 02:32 AM
Regardless the extension that you give to the file, SavePanelDisplayToFile produces a bitmap object and creates a bitmap file on disk, not a png one. You can check it looking into the code for the function in toolbox.c file: first of all the function obtains the bitmap object form the panel, next saves it to file. Now, it seems to me that bitmaps in CVI always follow the rule stated in on line help for PixelDepth field in NewBitmap function:
Regardless of the color depth that you specify, the new bitmap matches the color depth of the display screen.
Now, if you cannot reduce your screen color depth ancd indeed you want to obtain a smaller resolution you should run into the process or mapping 24bits into 8bits colors, or find a library that does this for you, next save the bitmap to file. It may not be the easiest thing of all...
Finally, you may find useful to use new SaveBitmapToXXXFile in the User Interface library, which permits you to create true PNG or JPEG files instead of BMP ones, but I'm afraid you will have the same limitations as of color depth since all these functions rely on bitmaps.
09-19-2006 01:57 PM