ホーム › Graphics.GdiPlus › GdipScalePenTransform
GdipScalePenTransform
関数ペンの変換行列に拡大縮小を適用する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipScalePenTransform(
GpPen* pen,
FLOAT sx,
FLOAT sy,
MatrixOrder order
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pen | GpPen* | inout |
| sx | FLOAT | in |
| sy | FLOAT | in |
| order | MatrixOrder | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipScalePenTransform(
GpPen* pen,
FLOAT sx,
FLOAT sy,
MatrixOrder order
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipScalePenTransform(
IntPtr pen, // GpPen* in/out
float sx, // FLOAT
float sy, // FLOAT
int order // MatrixOrder
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipScalePenTransform(
pen As IntPtr, ' GpPen* in/out
sx As Single, ' FLOAT
sy As Single, ' FLOAT
order As Integer ' MatrixOrder
) As Integer
End Function' pen : GpPen* in/out
' sx : FLOAT
' sy : FLOAT
' order : MatrixOrder
Declare PtrSafe Function GdipScalePenTransform Lib "gdiplus" ( _
ByVal pen As LongPtr, _
ByVal sx As Single, _
ByVal sy 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
GdipScalePenTransform = ctypes.windll.gdiplus.GdipScalePenTransform
GdipScalePenTransform.restype = ctypes.c_int
GdipScalePenTransform.argtypes = [
ctypes.c_void_p, # pen : GpPen* in/out
ctypes.c_float, # sx : FLOAT
ctypes.c_float, # sy : FLOAT
ctypes.c_int, # order : MatrixOrder
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipScalePenTransform = Fiddle::Function.new(
lib['GdipScalePenTransform'],
[
Fiddle::TYPE_VOIDP, # pen : GpPen* in/out
Fiddle::TYPE_FLOAT, # sx : FLOAT
Fiddle::TYPE_FLOAT, # sy : FLOAT
Fiddle::TYPE_INT, # order : MatrixOrder
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipScalePenTransform(
pen: *mut GpPen, // GpPen* in/out
sx: f32, // FLOAT
sy: f32, // FLOAT
order: i32 // MatrixOrder
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipScalePenTransform(IntPtr pen, float sx, float sy, int order);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipScalePenTransform' -Namespace Win32 -PassThru
# $api::GdipScalePenTransform(pen, sx, sy, order)#uselib "gdiplus.dll"
#func global GdipScalePenTransform "GdipScalePenTransform" sptr, float, float, sptr
; GdipScalePenTransform varptr(pen), sx, sy, order ; 戻り値は stat
; pen : GpPen* in/out -> "sptr"
; sx : FLOAT -> "float"
; sy : FLOAT -> "float"
; order : MatrixOrder -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipScalePenTransform "GdipScalePenTransform" var, float, float, int ; res = GdipScalePenTransform(pen, sx, sy, order) ; pen : GpPen* in/out -> "var" ; sx : FLOAT -> "float" ; sy : FLOAT -> "float" ; order : MatrixOrder -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipScalePenTransform "GdipScalePenTransform" sptr, float, float, int ; res = GdipScalePenTransform(varptr(pen), sx, sy, order) ; pen : GpPen* in/out -> "sptr" ; sx : FLOAT -> "float" ; sy : FLOAT -> "float" ; order : MatrixOrder -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipScalePenTransform(GpPen* pen, FLOAT sx, FLOAT sy, MatrixOrder order) #uselib "gdiplus.dll" #cfunc global GdipScalePenTransform "GdipScalePenTransform" var, float, float, int ; res = GdipScalePenTransform(pen, sx, sy, order) ; pen : GpPen* in/out -> "var" ; sx : FLOAT -> "float" ; sy : FLOAT -> "float" ; order : MatrixOrder -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipScalePenTransform(GpPen* pen, FLOAT sx, FLOAT sy, MatrixOrder order) #uselib "gdiplus.dll" #cfunc global GdipScalePenTransform "GdipScalePenTransform" intptr, float, float, int ; res = GdipScalePenTransform(varptr(pen), sx, sy, order) ; pen : GpPen* in/out -> "intptr" ; sx : FLOAT -> "float" ; sy : FLOAT -> "float" ; order : MatrixOrder -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"math"
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipScalePenTransform = gdiplus.NewProc("GdipScalePenTransform")
)
// pen (GpPen* in/out), sx (FLOAT), sy (FLOAT), order (MatrixOrder)
r1, _, err := procGdipScalePenTransform.Call(
uintptr(pen),
uintptr(math.Float32bits(sx)),
uintptr(math.Float32bits(sy)),
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 GdipScalePenTransform(
pen: Pointer; // GpPen* in/out
sx: Single; // FLOAT
sy: Single; // FLOAT
order: Integer // MatrixOrder
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipScalePenTransform';result := DllCall("gdiplus\GdipScalePenTransform"
, "Ptr", pen ; GpPen* in/out
, "Float", sx ; FLOAT
, "Float", sy ; FLOAT
, "Int", order ; MatrixOrder
, "Int") ; return: Status●GdipScalePenTransform(pen, sx, sy, order) = DLL("gdiplus.dll", "int GdipScalePenTransform(void*, float, float, int)")
# 呼び出し: GdipScalePenTransform(pen, sx, sy, order)
# pen : GpPen* in/out -> "void*"
# sx : FLOAT -> "float"
# sy : FLOAT -> "float"
# order : MatrixOrder -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。