ホーム › Graphics.GdiPlus › GdipSetWorldTransform
GdipSetWorldTransform
関数Graphicsのワールド変換行列を設定する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipSetWorldTransform(
GpGraphics* graphics,
Matrix* matrix
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| graphics | GpGraphics* | inout |
| matrix | Matrix* | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipSetWorldTransform(
GpGraphics* graphics,
Matrix* matrix
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetWorldTransform(
IntPtr graphics, // GpGraphics* in/out
ref IntPtr matrix // Matrix* in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetWorldTransform(
graphics As IntPtr, ' GpGraphics* in/out
ByRef matrix As IntPtr ' Matrix* in/out
) As Integer
End Function' graphics : GpGraphics* in/out
' matrix : Matrix* in/out
Declare PtrSafe Function GdipSetWorldTransform Lib "gdiplus" ( _
ByVal graphics As LongPtr, _
ByRef matrix As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipSetWorldTransform = ctypes.windll.gdiplus.GdipSetWorldTransform
GdipSetWorldTransform.restype = ctypes.c_int
GdipSetWorldTransform.argtypes = [
ctypes.c_void_p, # graphics : GpGraphics* in/out
ctypes.c_void_p, # matrix : Matrix* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipSetWorldTransform = Fiddle::Function.new(
lib['GdipSetWorldTransform'],
[
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # matrix : Matrix* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipSetWorldTransform(
graphics: *mut GpGraphics, // GpGraphics* 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 GdipSetWorldTransform(IntPtr graphics, ref IntPtr matrix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetWorldTransform' -Namespace Win32 -PassThru
# $api::GdipSetWorldTransform(graphics, matrix)#uselib "gdiplus.dll"
#func global GdipSetWorldTransform "GdipSetWorldTransform" sptr, sptr
; GdipSetWorldTransform varptr(graphics), matrix ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; matrix : Matrix* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipSetWorldTransform "GdipSetWorldTransform" var, int ; res = GdipSetWorldTransform(graphics, matrix) ; graphics : GpGraphics* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipSetWorldTransform "GdipSetWorldTransform" sptr, int ; res = GdipSetWorldTransform(varptr(graphics), matrix) ; graphics : GpGraphics* in/out -> "sptr" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipSetWorldTransform(GpGraphics* graphics, Matrix* matrix) #uselib "gdiplus.dll" #cfunc global GdipSetWorldTransform "GdipSetWorldTransform" var, int ; res = GdipSetWorldTransform(graphics, matrix) ; graphics : GpGraphics* in/out -> "var" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipSetWorldTransform(GpGraphics* graphics, Matrix* matrix) #uselib "gdiplus.dll" #cfunc global GdipSetWorldTransform "GdipSetWorldTransform" intptr, int ; res = GdipSetWorldTransform(varptr(graphics), matrix) ; graphics : GpGraphics* in/out -> "intptr" ; matrix : Matrix* in/out -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipSetWorldTransform = gdiplus.NewProc("GdipSetWorldTransform")
)
// graphics (GpGraphics* in/out), matrix (Matrix* in/out)
r1, _, err := procGdipSetWorldTransform.Call(
uintptr(graphics),
uintptr(matrix),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipSetWorldTransform(
graphics: Pointer; // GpGraphics* in/out
matrix: Pointer // Matrix* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipSetWorldTransform';result := DllCall("gdiplus\GdipSetWorldTransform"
, "Ptr", graphics ; GpGraphics* in/out
, "Ptr", matrix ; Matrix* in/out
, "Int") ; return: Status●GdipSetWorldTransform(graphics, matrix) = DLL("gdiplus.dll", "int GdipSetWorldTransform(void*, void*)")
# 呼び出し: GdipSetWorldTransform(graphics, matrix)
# graphics : GpGraphics* in/out -> "void*"
# matrix : Matrix* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。