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