Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › GdipCreatePath

GdipCreatePath

関数
指定した塗りつぶしモードでGDI+のパスを作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipCreatePath(
    FillMode brushMode,
    GpPath** path
);

パラメーター

名前方向
brushModeFillModein
pathGpPath**inout

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipCreatePath(
    FillMode brushMode,
    GpPath** path
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipCreatePath(
    int brushMode,   // FillMode
    IntPtr path   // GpPath** in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipCreatePath(
    brushMode As Integer,   ' FillMode
    path As IntPtr   ' GpPath** in/out
) As Integer
End Function
' brushMode : FillMode
' path : GpPath** in/out
Declare PtrSafe Function GdipCreatePath Lib "gdiplus" ( _
    ByVal brushMode As Long, _
    ByVal path As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipCreatePath = ctypes.windll.gdiplus.GdipCreatePath
GdipCreatePath.restype = ctypes.c_int
GdipCreatePath.argtypes = [
    ctypes.c_int,  # brushMode : FillMode
    ctypes.c_void_p,  # path : GpPath** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipCreatePath = Fiddle::Function.new(
  lib['GdipCreatePath'],
  [
    Fiddle::TYPE_INT,  # brushMode : FillMode
    Fiddle::TYPE_VOIDP,  # path : GpPath** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipCreatePath(
        brushMode: i32,  // FillMode
        path: *mut *mut GpPath  // GpPath** in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipCreatePath(int brushMode, IntPtr path);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreatePath' -Namespace Win32 -PassThru
# $api::GdipCreatePath(brushMode, path)
#uselib "gdiplus.dll"
#func global GdipCreatePath "GdipCreatePath" sptr, sptr
; GdipCreatePath brushMode, varptr(path)   ; 戻り値は stat
; brushMode : FillMode -> "sptr"
; path : GpPath** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipCreatePath "GdipCreatePath" int, var
; res = GdipCreatePath(brushMode, path)
; brushMode : FillMode -> "int"
; path : GpPath** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipCreatePath(FillMode brushMode, GpPath** path)
#uselib "gdiplus.dll"
#cfunc global GdipCreatePath "GdipCreatePath" int, var
; res = GdipCreatePath(brushMode, path)
; brushMode : FillMode -> "int"
; path : GpPath** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreatePath = gdiplus.NewProc("GdipCreatePath")
)

// brushMode (FillMode), path (GpPath** in/out)
r1, _, err := procGdipCreatePath.Call(
	uintptr(brushMode),
	uintptr(path),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipCreatePath(
  brushMode: Integer;   // FillMode
  path: Pointer   // GpPath** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipCreatePath';
result := DllCall("gdiplus\GdipCreatePath"
    , "Int", brushMode   ; FillMode
    , "Ptr", path   ; GpPath** in/out
    , "Int")   ; return: Status
●GdipCreatePath(brushMode, path) = DLL("gdiplus.dll", "int GdipCreatePath(int, void*)")
# 呼び出し: GdipCreatePath(brushMode, path)
# brushMode : FillMode -> "int"
# path : GpPath** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。