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

GdipSetLineTransform

関数
線形グラデーションブラシの変換行列を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipSetLineTransform(
    GpLineGradient* brush,
    const Matrix* matrix
);

パラメーター

名前方向
brushGpLineGradient*inout
matrixMatrix*in

戻り値の型: Status

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('gdiplus.dll')
GdipSetLineTransform = Fiddle::Function.new(
  lib['GdipSetLineTransform'],
  [
    Fiddle::TYPE_VOIDP,  # brush : GpLineGradient* in/out
    Fiddle::TYPE_VOIDP,  # matrix : Matrix*
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipSetLineTransform(
        brush: *mut GpLineGradient,  // GpLineGradient* in/out
        matrix: *const isize  // Matrix*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipSetLineTransform(IntPtr brush, ref IntPtr matrix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetLineTransform' -Namespace Win32 -PassThru
# $api::GdipSetLineTransform(brush, matrix)
#uselib "gdiplus.dll"
#func global GdipSetLineTransform "GdipSetLineTransform" sptr, sptr
; GdipSetLineTransform varptr(brush), matrix   ; 戻り値は stat
; brush : GpLineGradient* in/out -> "sptr"
; matrix : Matrix* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipSetLineTransform "GdipSetLineTransform" var, int
; res = GdipSetLineTransform(brush, matrix)
; brush : GpLineGradient* in/out -> "var"
; matrix : Matrix* -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipSetLineTransform(GpLineGradient* brush, Matrix* matrix)
#uselib "gdiplus.dll"
#cfunc global GdipSetLineTransform "GdipSetLineTransform" var, int
; res = GdipSetLineTransform(brush, matrix)
; brush : GpLineGradient* in/out -> "var"
; matrix : Matrix* -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetLineTransform = gdiplus.NewProc("GdipSetLineTransform")
)

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