ホーム › Graphics.GdiPlus › GdipWidenPath
GdipWidenPath
関数ペン幅を反映してGDI+のパスを縁取り形状に拡張する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipWidenPath(
GpPath* nativePath,
GpPen* pen,
Matrix* matrix,
FLOAT flatness
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| nativePath | GpPath* | inout |
| pen | GpPen* | inout |
| matrix | Matrix* | inout |
| flatness | FLOAT | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipWidenPath(
GpPath* nativePath,
GpPen* pen,
Matrix* matrix,
FLOAT flatness
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipWidenPath(
IntPtr nativePath, // GpPath* in/out
IntPtr pen, // GpPen* in/out
ref IntPtr matrix, // Matrix* in/out
float flatness // FLOAT
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipWidenPath(
nativePath As IntPtr, ' GpPath* in/out
pen As IntPtr, ' GpPen* in/out
ByRef matrix As IntPtr, ' Matrix* in/out
flatness As Single ' FLOAT
) As Integer
End Function' nativePath : GpPath* in/out
' pen : GpPen* in/out
' matrix : Matrix* in/out
' flatness : FLOAT
Declare PtrSafe Function GdipWidenPath Lib "gdiplus" ( _
ByVal nativePath As LongPtr, _
ByVal pen As LongPtr, _
ByRef matrix As LongPtr, _
ByVal flatness As Single) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipWidenPath = ctypes.windll.gdiplus.GdipWidenPath
GdipWidenPath.restype = ctypes.c_int
GdipWidenPath.argtypes = [
ctypes.c_void_p, # nativePath : GpPath* in/out
ctypes.c_void_p, # pen : GpPen* in/out
ctypes.c_void_p, # matrix : Matrix* in/out
ctypes.c_float, # flatness : FLOAT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipWidenPath = Fiddle::Function.new(
lib['GdipWidenPath'],
[
Fiddle::TYPE_VOIDP, # nativePath : GpPath* in/out
Fiddle::TYPE_VOIDP, # pen : GpPen* in/out
Fiddle::TYPE_VOIDP, # matrix : Matrix* in/out
Fiddle::TYPE_FLOAT, # flatness : FLOAT
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipWidenPath(
nativePath: *mut GpPath, // GpPath* in/out
pen: *mut GpPen, // GpPen* in/out
matrix: *mut isize, // Matrix* in/out
flatness: f32 // FLOAT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipWidenPath(IntPtr nativePath, IntPtr pen, ref IntPtr matrix, float flatness);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipWidenPath' -Namespace Win32 -PassThru
# $api::GdipWidenPath(nativePath, pen, matrix, flatness)#uselib "gdiplus.dll"
#func global GdipWidenPath "GdipWidenPath" sptr, sptr, sptr, float
; GdipWidenPath varptr(nativePath), varptr(pen), matrix, flatness ; 戻り値は stat
; nativePath : GpPath* in/out -> "sptr"
; pen : GpPen* in/out -> "sptr"
; matrix : Matrix* in/out -> "sptr"
; flatness : FLOAT -> "float"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipWidenPath "GdipWidenPath" var, var, int, float ; res = GdipWidenPath(nativePath, pen, matrix, flatness) ; nativePath : GpPath* in/out -> "var" ; pen : GpPen* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; flatness : FLOAT -> "float" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipWidenPath "GdipWidenPath" sptr, sptr, int, float ; res = GdipWidenPath(varptr(nativePath), varptr(pen), matrix, flatness) ; nativePath : GpPath* in/out -> "sptr" ; pen : GpPen* in/out -> "sptr" ; matrix : Matrix* in/out -> "int" ; flatness : FLOAT -> "float" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipWidenPath(GpPath* nativePath, GpPen* pen, Matrix* matrix, FLOAT flatness) #uselib "gdiplus.dll" #cfunc global GdipWidenPath "GdipWidenPath" var, var, int, float ; res = GdipWidenPath(nativePath, pen, matrix, flatness) ; nativePath : GpPath* in/out -> "var" ; pen : GpPen* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; flatness : FLOAT -> "float" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipWidenPath(GpPath* nativePath, GpPen* pen, Matrix* matrix, FLOAT flatness) #uselib "gdiplus.dll" #cfunc global GdipWidenPath "GdipWidenPath" intptr, intptr, int, float ; res = GdipWidenPath(varptr(nativePath), varptr(pen), matrix, flatness) ; nativePath : GpPath* in/out -> "intptr" ; pen : GpPen* in/out -> "intptr" ; matrix : Matrix* in/out -> "int" ; flatness : FLOAT -> "float" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipWidenPath = gdiplus.NewProc("GdipWidenPath")
)
// nativePath (GpPath* in/out), pen (GpPen* in/out), matrix (Matrix* in/out), flatness (FLOAT)
r1, _, err := procGdipWidenPath.Call(
uintptr(nativePath),
uintptr(pen),
uintptr(matrix),
uintptr(math.Float32bits(flatness)),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Status
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。function GdipWidenPath(
nativePath: Pointer; // GpPath* in/out
pen: Pointer; // GpPen* in/out
matrix: Pointer; // Matrix* in/out
flatness: Single // FLOAT
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipWidenPath';result := DllCall("gdiplus\GdipWidenPath"
, "Ptr", nativePath ; GpPath* in/out
, "Ptr", pen ; GpPen* in/out
, "Ptr", matrix ; Matrix* in/out
, "Float", flatness ; FLOAT
, "Int") ; return: Status●GdipWidenPath(nativePath, pen, matrix, flatness) = DLL("gdiplus.dll", "int GdipWidenPath(void*, void*, void*, float)")
# 呼び出し: GdipWidenPath(nativePath, pen, matrix, flatness)
# nativePath : GpPath* in/out -> "void*"
# pen : GpPen* in/out -> "void*"
# matrix : Matrix* in/out -> "void*"
# flatness : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。