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

GdipSetPenTransform

関数
ペンに適用する変換行列を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

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

パラメーター

名前方向
penGpPen*inout
matrixMatrix*inout

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipSetPenTransform(
    GpPen* pen,
    Matrix* matrix
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetPenTransform(
    IntPtr pen,   // GpPen* in/out
    ref IntPtr matrix   // Matrix* in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetPenTransform(
    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 GdipSetPenTransform 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

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

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