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

GdipGetRegionScans

関数
リージョンを構成する走査矩形の配列を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetRegionScans(
    GpRegion* region,
    RectF* rects,
    INT* count,
    Matrix* matrix
);

パラメーター

名前方向
regionGpRegion*inout
rectsRectF*inout
countINT*inout
matrixMatrix*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetRegionScans = ctypes.windll.gdiplus.GdipGetRegionScans
GdipGetRegionScans.restype = ctypes.c_int
GdipGetRegionScans.argtypes = [
    ctypes.c_void_p,  # region : GpRegion* in/out
    ctypes.c_void_p,  # rects : RectF* in/out
    ctypes.POINTER(ctypes.c_int),  # count : INT* in/out
    ctypes.c_void_p,  # matrix : Matrix* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetRegionScans = gdiplus.NewProc("GdipGetRegionScans")
)

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