函数参考


_GDIPlus_GraphicsFillPolygon

填充多边形

#Include <GDIPlus.au3>
_GDIPlus_GraphicsFillPolygon($hGraphics, $aPoints[, $hBrush = 0])

参数

$hGraphics 图形对象的句柄
$aPoints 多边形的顶点值数组:
[0][0] - 顶点数量
[1][0] - 顶点 1 的 X 位置
[1][1] - 顶点 1 的 Y 位置
[2][0] - 顶点 2 的 X 位置
[2][1] - 顶点 2 的 Y 位置
[n][0] - 顶点 n 的 X 位置
[n][1] - 顶点 n 的 Y 位置
$hBrush [可选参数] 用于填充多边形的画笔(brush)对象句柄.

返回值

成功: 返回 True
失败: 返回 False

注意/说明

None.

相关

详情参考

在MSDN中搜索


示例/演示


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

_Main()

Func _Main()
    Local $hGUI, $hGraphic, $aPoints[4][2]

    ; 创建 GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState()

    ; 描绘多边形
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

    $aPoints[0][0] = 3
    $aPoints[1][0] = 150
    $aPoints[1][1] = 150
    $aPoints[2][0] = 200
    $aPoints[2][1] = 100
    $aPoints[3][0] = 250
    $aPoints[3][1] = 150

    MsgBox(4096, "信息", "Fill Polygon")

    _GDIPlus_GraphicsFillPolygon($hGraphic, $aPoints)

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; 清理资源
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

EndFunc   ;==>_Main