Shiny Language Reference
Language Reference > Image Functions
saveimagepng
bool saveimagepng(image MyImage, string Filename);
Saves the specified image to a file
Experimental. The SAVEIMAGEPNG statement saves the specified image to the specified filename in PNG format (*.png), obeying per-pixel alpha (transparency) values. This statement has been included for future expansion of the Shiny language however is available for use immediately. An example use could be to load an image, rotate and scale it, then use this statement to save it back to disk.
Note that you are responsible for naming the file correctly, i.e.: with a ".png" extension. You may name the file anything you like, but the image will always be saved in a PNG format. For other formats, refer to saveimagejpg and saveimagebmp
Although this statement is experimental, plugin developers can take advantage of it immediately. Any changes to the operation of this statement will not affect any plugins that use it.
Parameters
MyImage
A variable declared as type IMAGE and previously associated with a bitmap image using the CREATEIMAGE statement.
Filename
The path and filename to save the image to. You are responsible for validating this value, as well as providing a .bmp extension.
Return Value
True if saving succeeded, otherwise False. Saving can fail in limited circumstances, for example when the image format is incompatible with the bitmap filetype, or the specified path and filename is invalid. At this time further behaviour is undefined as this feature is experimental.
Example Code
image MyImage;
if(createimage(MyImage, "C:\\MyBitmap.png") == TRUE)
{
// Invert the image
invertimage(MyImage);
// Save it back to disk
saveimagepng(MyImage, "C:\\MyBitmapInverted.png");
}