Function Reference

_GDIPlus_BrushGetType

Brushオブジェクトの種類を取得します。

#Include <GDIPlus.au3>
_GDIPlus_BrushGetType($hBrush)

 

パラメータ

$hBrush Brushオブジェクトのハンドル

 

返し値

成功: ブラシの種類:
0 - ソリッドカラー
1 - ハッチフィル
2 - テクスチャフィル
3 - パスグラデーション
4 - リニアグラデーション
Failure: -1が返され@errorが設定されます

 

注意

なし。

 

関連

 

こちらも参照

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

 


#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $iMemo

_Main()

Func _Main()
    Local $hGUI, $hBrush1, $hBrush2

    ; GUI作成
    $hGUI = GUICreate("GDI+", 400, 300)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 596, 396, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; ブラシを作成
    _GDIPlus_Startup ()
    $hBrush1 = _GDIPlus_BrushCreateSolid ()
    $hBrush2 = _GDIPlus_BrushClone ($hBrush1)

    ; ブラシの情報を表示
    MemoWrite("Brush 1 handle : 0x" & Hex($hBrush1))
    MemoWrite("Brush 1 type ..: " & _GDIPlus_BrushGetType ($hBrush1))
    MemoWrite("Brush 2 handle : 0x" & Hex($hBrush2))
    MemoWrite("Brush 2 type ..: " & _GDIPlus_BrushGetType ($hBrush2))

    ; リソースを破棄
    _GDIPlus_BrushDispose ($hBrush2)
    _GDIPlus_BrushDispose ($hBrush1)
    _GDIPlus_ShutDown ()

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main

; メモコントロールに1行書き込み
Func MemoWrite($sMessage = '')
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite