ホーム › Graphics.GdiPlus › GdipFillPath
GdipFillPath
関数指定ブラシでパスの内部領域を塗りつぶす。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipFillPath(
GpGraphics* graphics,
GpBrush* brush,
GpPath* path
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| graphics | GpGraphics* | inout |
| brush | GpBrush* | inout |
| path | GpPath* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipFillPath(
GpGraphics* graphics,
GpBrush* brush,
GpPath* path
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipFillPath(
IntPtr graphics, // GpGraphics* in/out
IntPtr brush, // GpBrush* in/out
IntPtr path // GpPath* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipFillPath(
graphics As IntPtr, ' GpGraphics* in/out
brush As IntPtr, ' GpBrush* in/out
path As IntPtr ' GpPath* in/out
) As Integer
End Function' graphics : GpGraphics* in/out
' brush : GpBrush* in/out
' path : GpPath* in/out
Declare PtrSafe Function GdipFillPath Lib "gdiplus" ( _
ByVal graphics As LongPtr, _
ByVal brush As LongPtr, _
ByVal path As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipFillPath = ctypes.windll.gdiplus.GdipFillPath
GdipFillPath.restype = ctypes.c_int
GdipFillPath.argtypes = [
ctypes.c_void_p, # graphics : GpGraphics* in/out
ctypes.c_void_p, # brush : GpBrush* in/out
ctypes.c_void_p, # path : GpPath* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipFillPath = Fiddle::Function.new(
lib['GdipFillPath'],
[
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # brush : GpBrush* in/out
Fiddle::TYPE_VOIDP, # path : GpPath* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipFillPath(
graphics: *mut GpGraphics, // GpGraphics* in/out
brush: *mut GpBrush, // GpBrush* in/out
path: *mut GpPath // GpPath* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipFillPath' -Namespace Win32 -PassThru
# $api::GdipFillPath(graphics, brush, path)#uselib "gdiplus.dll"
#func global GdipFillPath "GdipFillPath" sptr, sptr, sptr
; GdipFillPath varptr(graphics), varptr(brush), varptr(path) ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; brush : GpBrush* in/out -> "sptr"
; path : GpPath* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipFillPath "GdipFillPath" var, var, var ; res = GdipFillPath(graphics, brush, path) ; graphics : GpGraphics* in/out -> "var" ; brush : GpBrush* in/out -> "var" ; path : GpPath* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipFillPath "GdipFillPath" sptr, sptr, sptr ; res = GdipFillPath(varptr(graphics), varptr(brush), varptr(path)) ; graphics : GpGraphics* in/out -> "sptr" ; brush : GpBrush* in/out -> "sptr" ; path : GpPath* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipFillPath(GpGraphics* graphics, GpBrush* brush, GpPath* path) #uselib "gdiplus.dll" #cfunc global GdipFillPath "GdipFillPath" var, var, var ; res = GdipFillPath(graphics, brush, path) ; graphics : GpGraphics* in/out -> "var" ; brush : GpBrush* in/out -> "var" ; path : GpPath* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipFillPath(GpGraphics* graphics, GpBrush* brush, GpPath* path) #uselib "gdiplus.dll" #cfunc global GdipFillPath "GdipFillPath" intptr, intptr, intptr ; res = GdipFillPath(varptr(graphics), varptr(brush), varptr(path)) ; graphics : GpGraphics* in/out -> "intptr" ; brush : GpBrush* in/out -> "intptr" ; path : GpPath* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipFillPath = gdiplus.NewProc("GdipFillPath")
)
// graphics (GpGraphics* in/out), brush (GpBrush* in/out), path (GpPath* in/out)
r1, _, err := procGdipFillPath.Call(
uintptr(graphics),
uintptr(brush),
uintptr(path),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipFillPath(
graphics: Pointer; // GpGraphics* in/out
brush: Pointer; // GpBrush* in/out
path: Pointer // GpPath* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipFillPath';result := DllCall("gdiplus\GdipFillPath"
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", brush ; GpBrush* in/out
, "Ptr", path ; GpPath* in/out
, "Int") ; return: Status●GdipFillPath(graphics, brush, path) = DLL("gdiplus.dll", "int GdipFillPath(void*, void*, void*)")
# 呼び出し: GdipFillPath(graphics, brush, path)
# graphics : GpGraphics* in/out -> "void*"
# brush : GpBrush* in/out -> "void*"
# path : GpPath* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。