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

GdipScaleLineTransform

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

シグネチャ

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

Status GdipScaleLineTransform(
    GpLineGradient* brush,
    FLOAT sx,
    FLOAT sy,
    MatrixOrder order
);

パラメーター

名前方向
brushGpLineGradient*inout
sxFLOATin
syFLOATin
orderMatrixOrderin

戻り値の型: Status

各言語での呼び出し定義

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

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

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

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