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