Function Reference

_GDIPlus_GraphicsClear

Graphicsオブジェクトを指定された色でクリアします。

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

 

パラメータ

$hGraphics Graphicsオブジェクトのハンドル
$iARGB [オプション]色のアルファ、赤、緑、青成分

 

返し値

成功: True
失敗: False

 

注意

なし。

 

関連

 

こちらも参照

MSDNライブラリでGdipGraphicsClearを検索して下さい。

 


#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <WinAPI.au3>

Opt('MustDeclareVars', 1)

_Main()

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

    ; GDI+ライブラリを初期化
    _GDIPlus_Startup ()

    ; スクリーン領域をキャプチャ
    $hBitmap = _ScreenCapture_Capture ("", 0, 0, 400, 300)
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap)

    ; スクリーンキャプチャをソリッドな青でクリア
    $hGraphic = _GDIPlus_ImageGetGraphicsContext ($hImage)
    _GDIPlus_GraphicsClear ($hGraphic)

    ; 結果画像を保存
    _GDIPlus_ImageSaveToFile ($hImage, @MyDocumentsDir & "\GDIPlus_Image.jpg")

    ; リソースを破棄
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ImageDispose ($hImage)
    _WinAPI_DeleteObject ($hBitmap)

    ; GDI+ライブラリを閉じる
    _GDIPlus_ShutDown ()

EndFunc   ;==>_Main