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

GdipGetPathGradientRectI

関数
パスグラデーションの外接矩形を整数座標で取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPathGradientRectI(
    GpPathGradient* brush,
    Rect* rect
);

パラメーター

名前方向
brushGpPathGradient*inout
rectRect*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPathGradientRectI = ctypes.windll.gdiplus.GdipGetPathGradientRectI
GdipGetPathGradientRectI.restype = ctypes.c_int
GdipGetPathGradientRectI.argtypes = [
    ctypes.c_void_p,  # brush : GpPathGradient* in/out
    ctypes.c_void_p,  # rect : Rect* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPathGradientRectI = gdiplus.NewProc("GdipGetPathGradientRectI")
)

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