ホーム › Graphics.GdiPlus › GdipRotateMatrix
GdipRotateMatrix
関数変換行列に回転を適用する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipRotateMatrix(
Matrix* matrix,
FLOAT angle,
MatrixOrder order
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| matrix | Matrix* | inout |
| angle | FLOAT | in |
| order | MatrixOrder | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipRotateMatrix(
Matrix* matrix,
FLOAT angle,
MatrixOrder order
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipRotateMatrix(
ref IntPtr matrix, // Matrix* in/out
float angle, // FLOAT
int order // MatrixOrder
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipRotateMatrix(
ByRef matrix As IntPtr, ' Matrix* in/out
angle As Single, ' FLOAT
order As Integer ' MatrixOrder
) As Integer
End Function' matrix : Matrix* in/out
' angle : FLOAT
' order : MatrixOrder
Declare PtrSafe Function GdipRotateMatrix Lib "gdiplus" ( _
ByRef matrix As LongPtr, _
ByVal angle As Single, _
ByVal order As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipRotateMatrix = ctypes.windll.gdiplus.GdipRotateMatrix
GdipRotateMatrix.restype = ctypes.c_int
GdipRotateMatrix.argtypes = [
ctypes.c_void_p, # matrix : Matrix* in/out
ctypes.c_float, # angle : FLOAT
ctypes.c_int, # order : MatrixOrder
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipRotateMatrix = Fiddle::Function.new(
lib['GdipRotateMatrix'],
[
Fiddle::TYPE_VOIDP, # matrix : Matrix* in/out
Fiddle::TYPE_FLOAT, # angle : FLOAT
Fiddle::TYPE_INT, # order : MatrixOrder
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipRotateMatrix(
matrix: *mut isize, // Matrix* in/out
angle: f32, // FLOAT
order: i32 // MatrixOrder
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipRotateMatrix(ref IntPtr matrix, float angle, int order);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipRotateMatrix' -Namespace Win32 -PassThru
# $api::GdipRotateMatrix(matrix, angle, order)#uselib "gdiplus.dll"
#func global GdipRotateMatrix "GdipRotateMatrix" sptr, float, sptr
; GdipRotateMatrix matrix, angle, order ; 戻り値は stat
; matrix : Matrix* in/out -> "sptr"
; angle : FLOAT -> "float"
; order : MatrixOrder -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "gdiplus.dll"
#cfunc global GdipRotateMatrix "GdipRotateMatrix" int, float, int
; res = GdipRotateMatrix(matrix, angle, order)
; matrix : Matrix* in/out -> "int"
; angle : FLOAT -> "float"
; order : MatrixOrder -> "int"; Status GdipRotateMatrix(Matrix* matrix, FLOAT angle, MatrixOrder order)
#uselib "gdiplus.dll"
#cfunc global GdipRotateMatrix "GdipRotateMatrix" int, float, int
; res = GdipRotateMatrix(matrix, angle, order)
; matrix : Matrix* in/out -> "int"
; angle : FLOAT -> "float"
; order : MatrixOrder -> "int"import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipRotateMatrix = gdiplus.NewProc("GdipRotateMatrix")
)
// matrix (Matrix* in/out), angle (FLOAT), order (MatrixOrder)
r1, _, err := procGdipRotateMatrix.Call(
uintptr(matrix),
uintptr(math.Float32bits(angle)),
uintptr(order),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Status
// 注意: float/double 引数は proc.Call では XMM レジスタに渡せません。
// windows.SyscallN(proc.Addr(), math.Float64bits(x), ...) もしくは cgo を使用してください。function GdipRotateMatrix(
matrix: Pointer; // Matrix* in/out
angle: Single; // FLOAT
order: Integer // MatrixOrder
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipRotateMatrix';result := DllCall("gdiplus\GdipRotateMatrix"
, "Ptr", matrix ; Matrix* in/out
, "Float", angle ; FLOAT
, "Int", order ; MatrixOrder
, "Int") ; return: Status●GdipRotateMatrix(matrix, angle, order) = DLL("gdiplus.dll", "int GdipRotateMatrix(void*, float, int)")
# 呼び出し: GdipRotateMatrix(matrix, angle, order)
# matrix : Matrix* in/out -> "void*"
# angle : FLOAT -> "float"
# order : MatrixOrder -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。