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

GdipTranslateClipI

関数
Graphicsのクリップ領域を整数値で平行移動する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipTranslateClipI(
    GpGraphics* graphics,
    INT dx,
    INT dy
);

パラメーター

名前方向
graphicsGpGraphics*inout
dxINTin
dyINTin

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipTranslateClipI(
    GpGraphics* graphics,
    INT dx,
    INT dy
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipTranslateClipI(
    IntPtr graphics,   // GpGraphics* in/out
    int dx,   // INT
    int dy   // INT
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipTranslateClipI(
    graphics As IntPtr,   ' GpGraphics* in/out
    dx As Integer,   ' INT
    dy As Integer   ' INT
) As Integer
End Function
' graphics : GpGraphics* in/out
' dx : INT
' dy : INT
Declare PtrSafe Function GdipTranslateClipI Lib "gdiplus" ( _
    ByVal graphics 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

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

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipTranslateClipI = gdiplus.NewProc("GdipTranslateClipI")
)

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