Function Reference


Clears a Graphics object to a specified color

#include <GDIPlus.au3>
_GDIPlus_GraphicsClear ( $hGraphics [, $iARGB = 0xFF000000] )


$hGraphics Handle to a Graphics object
$iARGB [optional] Alpha, Red, Green and Blue components of color

Return Value

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).

See Also

Search GdipGraphicsClear in MSDN Library.


#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WinAPIHObj.au3>


Func Example()
    Local $hBitmap, $hImage, $hGraphic

    ; Initialize GDI+ library

    ; Capture screen region
    $hBitmap = _ScreenCapture_Capture("", 0, 0, 400, 300)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)

    ; Clear the screen capture
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)

    ; Save resultant image
    _GDIPlus_ImageSaveToFile($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg")

    ; Clean up resources

    ; Shut down GDI+ library

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