FW_SaveHBitmap( hBitmap, cBmpFile ) --> lSuccess
FW_SaveHIContoIco( hIcon, cIconFile ) --> lSuccess
The above two functions are self explanatory.
FW_SaveImage( [uSource], [cFile], [lJpgQuality] ) --> lSuccess
Parameters:
1. uSource (optional):
(a) If empty, image in clipboard, if any, is taken as the source.
(b) hBitmap
(c) hIcon: (i) If the destination file has extension "ico", the image is saved using function FW_SaveHIcontoIco(). (ii) Otherwise, hIcon is converted to hBitmap for saving in other formats
(d) pImage (gdi+ image pointer)
(e) URL pointing to any image on the Web.
(f) Resource name of any image
(g) Image file on disk:
By default, files with extensions bmp,jpg,jpeg,tif,tiff,gif,png are supported.
If freeimage.dll is available, any file type supported by the dll are accepted.
In other cases, the function returns failure.
2. cFile (optional):
If omitted, a file selector dialog is displayed and the user has to select a file name with any supported extension.
Supported filetypes, by default, are bmp,jpg,jpeg,tif,tiff,gif,png.
If freeimage.dll is available, any file type supported by the dll can be selected.
3. nJpegQuality (optional) Used only for jpg/jpeg files
Range 0 (maximum compression) to 100 (no compression). Default 10
Note: If both source file and destination file have the same extension, the source file is simply copied to the destination.
Saving contents of Window/Dialog/Controls:
New method SaveAsImage( cFile, [aRect] ) can be used. By default, the entire client area is saved.
XImage:
oImage:Save( cFile, .t. ): Saves whatever is viewed in the image control.
oImage:Save( cFile, .f. ): Saves original image without any transformations.
FW_TransformBitmap( hBitmap, [aCrop], [nZoom], [nRotate] ) --> modified bitmap
Parameters are self explanatory.
Example usage:
- Code: Select all Expand view
hBmp := FW_ReadImage( nil, "\fwh\bitmaps\olga1.jpg" )[ 1 ]
hNew := FW_TransormBitmap( hBmp, { 0.2, 0.2, -0.2, -0.2 }, 0.75, 45 )
FW_SaveImage( hNew, "olganew.png" )