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

GdipScalePathGradientTransform

関数
パスグラデーションの変換に拡大縮小を適用する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipScalePathGradientTransform(
    GpPathGradient* brush,
    FLOAT sx,
    FLOAT sy,
    MatrixOrder order
);

パラメーター

名前方向
brushGpPathGradient*inout
sxFLOATin
syFLOATin
orderMatrixOrderin

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipScalePathGradientTransform(
    GpPathGradient* brush,
    FLOAT sx,
    FLOAT sy,
    MatrixOrder order
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipScalePathGradientTransform(
    IntPtr brush,   // GpPathGradient* in/out
    float sx,   // FLOAT
    float sy,   // FLOAT
    int order   // MatrixOrder
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipScalePathGradientTransform(
    brush As IntPtr,   ' GpPathGradient* in/out
    sx As Single,   ' FLOAT
    sy As Single,   ' FLOAT
    order As Integer   ' MatrixOrder
) As Integer
End Function
' brush : GpPathGradient* in/out
' sx : FLOAT
' sy : FLOAT
' order : MatrixOrder
Declare PtrSafe Function GdipScalePathGradientTransform Lib "gdiplus" ( _
    ByVal brush 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

GdipScalePathGradientTransform = ctypes.windll.gdiplus.GdipScalePathGradientTransform
GdipScalePathGradientTransform.restype = ctypes.c_int
GdipScalePathGradientTransform.argtypes = [
    ctypes.c_void_p,  # brush : GpPathGradient* 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')
GdipScalePathGradientTransform = Fiddle::Function.new(
  lib['GdipScalePathGradientTransform'],
  [
    Fiddle::TYPE_VOIDP,  # brush : GpPathGradient* 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 GdipScalePathGradientTransform(
        brush: *mut GpPathGradient,  // GpPathGradient* 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 GdipScalePathGradientTransform(IntPtr brush, float sx, float sy, int order);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipScalePathGradientTransform' -Namespace Win32 -PassThru
# $api::GdipScalePathGradientTransform(brush, sx, sy, order)
#uselib "gdiplus.dll"
#func global GdipScalePathGradientTransform "GdipScalePathGradientTransform" sptr, float, float, sptr
; GdipScalePathGradientTransform varptr(brush), sx, sy, order   ; 戻り値は stat
; brush : GpPathGradient* in/out -> "sptr"
; sx : FLOAT -> "float"
; sy : FLOAT -> "float"
; order : MatrixOrder -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipScalePathGradientTransform "GdipScalePathGradientTransform" var, float, float, int
; res = GdipScalePathGradientTransform(brush, sx, sy, order)
; brush : GpPathGradient* in/out -> "var"
; sx : FLOAT -> "float"
; sy : FLOAT -> "float"
; order : MatrixOrder -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipScalePathGradientTransform(GpPathGradient* brush, FLOAT sx, FLOAT sy, MatrixOrder order)
#uselib "gdiplus.dll"
#cfunc global GdipScalePathGradientTransform "GdipScalePathGradientTransform" var, float, float, int
; res = GdipScalePathGradientTransform(brush, sx, sy, order)
; brush : GpPathGradient* in/out -> "var"
; sx : FLOAT -> "float"
; sy : FLOAT -> "float"
; order : MatrixOrder -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipScalePathGradientTransform = gdiplus.NewProc("GdipScalePathGradientTransform")
)

// brush (GpPathGradient* in/out), sx (FLOAT), sy (FLOAT), order (MatrixOrder)
r1, _, err := procGdipScalePathGradientTransform.Call(
	uintptr(brush),
	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 GdipScalePathGradientTransform(
  brush: Pointer;   // GpPathGradient* in/out
  sx: Single;   // FLOAT
  sy: Single;   // FLOAT
  order: Integer   // MatrixOrder
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipScalePathGradientTransform';
result := DllCall("gdiplus\GdipScalePathGradientTransform"
    , "Ptr", brush   ; GpPathGradient* in/out
    , "Float", sx   ; FLOAT
    , "Float", sy   ; FLOAT
    , "Int", order   ; MatrixOrder
    , "Int")   ; return: Status
●GdipScalePathGradientTransform(brush, sx, sy, order) = DLL("gdiplus.dll", "int GdipScalePathGradientTransform(void*, float, float, int)")
# 呼び出し: GdipScalePathGradientTransform(brush, sx, sy, order)
# brush : GpPathGradient* in/out -> "void*"
# sx : FLOAT -> "float"
# sy : FLOAT -> "float"
# order : MatrixOrder -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。