ホーム › Graphics.GdiPlus › GdipGetRegionScansI
GdipGetRegionScansI
関数リージョンの走査矩形配列を整数座標で取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetRegionScansI(
GpRegion* region,
Rect* rects,
INT* count,
Matrix* matrix
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| region | GpRegion* | inout |
| rects | Rect* | inout |
| count | INT* | inout |
| matrix | Matrix* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipGetRegionScansI(
GpRegion* region,
Rect* rects,
INT* count,
Matrix* matrix
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetRegionScansI(
IntPtr region, // GpRegion* in/out
IntPtr rects, // Rect* in/out
ref int count, // INT* in/out
ref IntPtr matrix // Matrix* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetRegionScansI(
region As IntPtr, ' GpRegion* in/out
rects As IntPtr, ' Rect* 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 : Rect* in/out
' count : INT* in/out
' matrix : Matrix* in/out
Declare PtrSafe Function GdipGetRegionScansI 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
GdipGetRegionScansI = ctypes.windll.gdiplus.GdipGetRegionScansI
GdipGetRegionScansI.restype = ctypes.c_int
GdipGetRegionScansI.argtypes = [
ctypes.c_void_p, # region : GpRegion* in/out
ctypes.c_void_p, # rects : Rect* 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')
GdipGetRegionScansI = Fiddle::Function.new(
lib['GdipGetRegionScansI'],
[
Fiddle::TYPE_VOIDP, # region : GpRegion* in/out
Fiddle::TYPE_VOIDP, # rects : Rect* 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 GdipGetRegionScansI(
region: *mut GpRegion, // GpRegion* in/out
rects: *mut Rect, // Rect* 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 GdipGetRegionScansI(IntPtr region, IntPtr rects, ref int count, ref IntPtr matrix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetRegionScansI' -Namespace Win32 -PassThru
# $api::GdipGetRegionScansI(region, rects, count, matrix)#uselib "gdiplus.dll"
#func global GdipGetRegionScansI "GdipGetRegionScansI" sptr, sptr, sptr, sptr
; GdipGetRegionScansI varptr(region), varptr(rects), varptr(count), matrix ; 戻り値は stat
; region : GpRegion* in/out -> "sptr"
; rects : Rect* in/out -> "sptr"
; count : INT* in/out -> "sptr"
; matrix : Matrix* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipGetRegionScansI "GdipGetRegionScansI" var, var, var, int ; res = GdipGetRegionScansI(region, rects, count, matrix) ; region : GpRegion* in/out -> "var" ; rects : Rect* in/out -> "var" ; count : INT* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetRegionScansI "GdipGetRegionScansI" sptr, sptr, sptr, int ; res = GdipGetRegionScansI(varptr(region), varptr(rects), varptr(count), matrix) ; region : GpRegion* in/out -> "sptr" ; rects : Rect* in/out -> "sptr" ; count : INT* in/out -> "sptr" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipGetRegionScansI(GpRegion* region, Rect* rects, INT* count, Matrix* matrix) #uselib "gdiplus.dll" #cfunc global GdipGetRegionScansI "GdipGetRegionScansI" var, var, var, int ; res = GdipGetRegionScansI(region, rects, count, matrix) ; region : GpRegion* in/out -> "var" ; rects : Rect* in/out -> "var" ; count : INT* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipGetRegionScansI(GpRegion* region, Rect* rects, INT* count, Matrix* matrix) #uselib "gdiplus.dll" #cfunc global GdipGetRegionScansI "GdipGetRegionScansI" intptr, intptr, intptr, int ; res = GdipGetRegionScansI(varptr(region), varptr(rects), varptr(count), matrix) ; region : GpRegion* in/out -> "intptr" ; rects : Rect* in/out -> "intptr" ; count : INT* in/out -> "intptr" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipGetRegionScansI = gdiplus.NewProc("GdipGetRegionScansI")
)
// region (GpRegion* in/out), rects (Rect* in/out), count (INT* in/out), matrix (Matrix* in/out)
r1, _, err := procGdipGetRegionScansI.Call(
uintptr(region),
uintptr(rects),
uintptr(count),
uintptr(matrix),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipGetRegionScansI(
region: Pointer; // GpRegion* in/out
rects: Pointer; // Rect* in/out
count: Pointer; // INT* in/out
matrix: Pointer // Matrix* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipGetRegionScansI';result := DllCall("gdiplus\GdipGetRegionScansI"
, "Ptr", region ; GpRegion* in/out
, "Ptr", rects ; Rect* in/out
, "Ptr", count ; INT* in/out
, "Ptr", matrix ; Matrix* in/out
, "Int") ; return: Status●GdipGetRegionScansI(region, rects, count, matrix) = DLL("gdiplus.dll", "int GdipGetRegionScansI(void*, void*, void*, void*)")
# 呼び出し: GdipGetRegionScansI(region, rects, count, matrix)
# region : GpRegion* in/out -> "void*"
# rects : Rect* in/out -> "void*"
# count : INT* in/out -> "void*"
# matrix : Matrix* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。