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

GdipGetPenTransform

関数
ペンに適用されている変換行列を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPenTransform(
    GpPen* pen,
    Matrix* matrix
);

パラメーター

名前方向
penGpPen*inout
matrixMatrix*inout

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipGetPenTransform(
    GpPen* pen,
    Matrix* matrix
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetPenTransform(
    IntPtr pen,   // GpPen* in/out
    ref IntPtr matrix   // Matrix* in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetPenTransform(
    pen As IntPtr,   ' GpPen* in/out
    ByRef matrix As IntPtr   ' Matrix* in/out
) As Integer
End Function
' pen : GpPen* in/out
' matrix : Matrix* in/out
Declare PtrSafe Function GdipGetPenTransform Lib "gdiplus" ( _
    ByVal pen 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

GdipGetPenTransform = ctypes.windll.gdiplus.GdipGetPenTransform
GdipGetPenTransform.restype = ctypes.c_int
GdipGetPenTransform.argtypes = [
    ctypes.c_void_p,  # pen : GpPen* in/out
    ctypes.c_void_p,  # matrix : Matrix* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPenTransform = gdiplus.NewProc("GdipGetPenTransform")
)

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