SaveImage
| Description: | Takes an image handle and saves it to an image file on disk. |
| Returns: | Handle to image |
Usage: ![]() |
Script Only. |
| Function Groups: | Graphics |
| Related to: | CaptureImage | MakeBitmap | ModifyBitmap |
Format: ![]() |
SaveImage(BitmapHandle, Filename, [MIMEType, Width, Height]) |
| Parameters: |
| BitmapHandle |
| Required. The handle to the image to be saved. |
| Filename |
| Required. Any text expression for the name to be given to the new file. |
| MIMEType |
| Optional text for the format to be used. Defaults to "image/png" if not specified. Options include "image/bmp", "image/jpeg", "image/gif", "image/tiff", and "image/png". |
| Width |
| Optional. Any numeric expression for the width of the image in pixels. Defaults to the native size of the image. |
| Height |
| Optional. Any numeric expression for the height of the image in pixels. Defaults to the native size of the image. |
| Comments: |
Examples:
SaveImage can be used in conjunction with ModifyBitmap. For example the following code snippet can be used on a VTScada application page (in script):
SaveImage(ModifyBitmap(CaptureImage(Caller(Self())),
FALSE { Mirror },
0 { Hue },
Invalid { Saturation },
Invalid { Lightness },
Invalid { Transparency },
Invalid { Contrast },
Invalid { ColorizeHue },
Invalid { ColorizeIntensity},
TRUE { AntiAlias }),
"c:\temp\page.png", "image/png", 1000, 500);
To capture an image of the page, modify it to enable anti-aliasing so that high-quality interpolation will be used for the downsizing, and save it as a 1000x500 PNG.
