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

GdipGetPathWorldBounds

関数
変換とペンを考慮したGDI+パスの外接矩形を取得する(浮動小数点版)。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPathWorldBounds(
    GpPath* path,
    RectF* bounds,
    const Matrix* matrix,
    const GpPen* pen
);

パラメーター

名前方向
pathGpPath*inout
boundsRectF*inout
matrixMatrix*in
penGpPen*in

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipGetPathWorldBounds(
    GpPath* path,
    RectF* bounds,
    const Matrix* matrix,
    const GpPen* pen
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetPathWorldBounds(
    IntPtr path,   // GpPath* in/out
    IntPtr bounds,   // RectF* in/out
    ref IntPtr matrix,   // Matrix*
    IntPtr pen   // GpPen*
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetPathWorldBounds(
    path As IntPtr,   ' GpPath* in/out
    bounds As IntPtr,   ' RectF* in/out
    ByRef matrix As IntPtr,   ' Matrix*
    pen As IntPtr   ' GpPen*
) As Integer
End Function
' path : GpPath* in/out
' bounds : RectF* in/out
' matrix : Matrix*
' pen : GpPen*
Declare PtrSafe Function GdipGetPathWorldBounds 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

GdipGetPathWorldBounds = ctypes.windll.gdiplus.GdipGetPathWorldBounds
GdipGetPathWorldBounds.restype = ctypes.c_int
GdipGetPathWorldBounds.argtypes = [
    ctypes.c_void_p,  # path : GpPath* in/out
    ctypes.c_void_p,  # bounds : RectF* in/out
    ctypes.c_void_p,  # matrix : Matrix*
    ctypes.c_void_p,  # pen : GpPen*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipGetPathWorldBounds = Fiddle::Function.new(
  lib['GdipGetPathWorldBounds'],
  [
    Fiddle::TYPE_VOIDP,  # path : GpPath* in/out
    Fiddle::TYPE_VOIDP,  # bounds : RectF* in/out
    Fiddle::TYPE_VOIDP,  # matrix : Matrix*
    Fiddle::TYPE_VOIDP,  # pen : GpPen*
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipGetPathWorldBounds(
        path: *mut GpPath,  // GpPath* in/out
        bounds: *mut RectF,  // RectF* 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 GdipGetPathWorldBounds(IntPtr path, IntPtr bounds, ref IntPtr matrix, IntPtr pen);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetPathWorldBounds' -Namespace Win32 -PassThru
# $api::GdipGetPathWorldBounds(path, bounds, matrix, pen)
#uselib "gdiplus.dll"
#func global GdipGetPathWorldBounds "GdipGetPathWorldBounds" sptr, sptr, sptr, sptr
; GdipGetPathWorldBounds varptr(path), varptr(bounds), matrix, varptr(pen)   ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; bounds : RectF* in/out -> "sptr"
; matrix : Matrix* -> "sptr"
; pen : GpPen* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipGetPathWorldBounds "GdipGetPathWorldBounds" var, var, int, var
; res = GdipGetPathWorldBounds(path, bounds, matrix, pen)
; path : GpPath* in/out -> "var"
; bounds : RectF* in/out -> "var"
; matrix : Matrix* -> "int"
; pen : GpPen* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipGetPathWorldBounds(GpPath* path, RectF* bounds, Matrix* matrix, GpPen* pen)
#uselib "gdiplus.dll"
#cfunc global GdipGetPathWorldBounds "GdipGetPathWorldBounds" var, var, int, var
; res = GdipGetPathWorldBounds(path, bounds, matrix, pen)
; path : GpPath* in/out -> "var"
; bounds : RectF* in/out -> "var"
; matrix : Matrix* -> "int"
; pen : GpPen* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPathWorldBounds = gdiplus.NewProc("GdipGetPathWorldBounds")
)

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