Function Reference


_ScreenCapture_SaveImage

Saves an image to file

#include <ScreenCapture.au3>
_ScreenCapture_SaveImage ( $sFileName, $hBitmap [, $bFreeBmp = True] )

Parameters

$sFileName Full path and extension of the bitmap file to be saved
$hBitmap HBITMAP handle
$bFreeBmp [optional] If True, $hBitmap will be freed on a successful save (default)

Return Value

Success: True.
Failure: False.

Remarks

This function saves a bitmap to file, converting it to the image format specified by the file name extension.
For Windows XP, the valid extensions are BMP, GIF, JPEG, PNG and TIF.

Related

_ScreenCapture_Capture

Example

#include <ScreenCapture.au3>

Example()

Func Example()
        Local $hBmp

        ; Capture full screen
        $hBmp = _ScreenCapture_Capture("")

        ; Save bitmap to file
        _ScreenCapture_SaveImage(@MyDocumentsDir & "\GDIPlus_Image.jpg", $hBmp)

        ShellExecute(@MyDocumentsDir & "\GDIPlus_Image.jpg")
EndFunc   ;==>Example