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

GdipTranslateRegionI

関数
リージョンを整数値で指定して平行移動する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipTranslateRegionI(
    GpRegion* region,
    INT dx,
    INT dy
);

パラメーター

名前方向
regionGpRegion*inout
dxINTin
dyINTin

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipTranslateRegionI = ctypes.windll.gdiplus.GdipTranslateRegionI
GdipTranslateRegionI.restype = ctypes.c_int
GdipTranslateRegionI.argtypes = [
    ctypes.c_void_p,  # region : GpRegion* in/out
    ctypes.c_int,  # dx : INT
    ctypes.c_int,  # dy : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipTranslateRegionI = gdiplus.NewProc("GdipTranslateRegionI")
)

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