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