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

GdipCreateRegionRectI

関数
整数座標の矩形からリージョンを作成する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipCreateRegionRectI(
    const Rect* rect,
    GpRegion** region
);

パラメーター

名前方向
rectRect*in
regionGpRegion**inout

戻り値の型: Status

各言語での呼び出し定義

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

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

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

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipCreateRegionRectI = gdiplus.NewProc("GdipCreateRegionRectI")
)

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