Admin Production ni-theme
Current Publication

SaveBitmapToPNGFile

LabWindows/CVI

SaveBitmapToPNGFile

int SaveBitmapToPNGFile (int bitmapID, char filename[]);

Purpose

Saves a bitmap image to a .png file. The .png file format is the only format in which you can save alpha-channel transparency data. You also can save any mask you have applied to the bitmap. The file will retain full transparency on masked pixels.

Note Note  SaveBitmapToPNGFile generates a 32-bit .png file regardless of the pixel depth of the original bitmap.

Parameters

Input
Name Type Description
bitmapID int ID of the bitmap object that contains the image. You can obtain the ID from functions such as NewBitmapEx and GetCtrlBitmap.
filename char [] Pathname of the file in which to save the image.

You can use a complete pathname or a simple filename. If the name is a simple filename, the file is saved in the directory that contains the executable.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 8.0 and later

Example

Refer to apps\iconedit\iconedit.cws for an example of using the SaveBitmapToPNGFile function.