ホーム › Graphics.GdiPlus › GdipSetPathGradientBlend
GdipSetPathGradientBlend
関数パスグラデーションのブレンド係数と位置を設定する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipSetPathGradientBlend(
GpPathGradient* brush,
const FLOAT* blend,
const FLOAT* positions,
INT count
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| brush | GpPathGradient* | inout |
| blend | FLOAT* | in |
| positions | FLOAT* | in |
| count | INT | in |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipSetPathGradientBlend(
GpPathGradient* brush,
const FLOAT* blend,
const FLOAT* positions,
INT count
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetPathGradientBlend(
IntPtr brush, // GpPathGradient* in/out
ref float blend, // FLOAT*
ref float positions, // FLOAT*
int count // INT
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetPathGradientBlend(
brush As IntPtr, ' GpPathGradient* in/out
ByRef blend As Single, ' FLOAT*
ByRef positions As Single, ' FLOAT*
count As Integer ' INT
) As Integer
End Function' brush : GpPathGradient* in/out
' blend : FLOAT*
' positions : FLOAT*
' count : INT
Declare PtrSafe Function GdipSetPathGradientBlend Lib "gdiplus" ( _
ByVal brush As LongPtr, _
ByRef blend As Single, _
ByRef positions As Single, _
ByVal count As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipSetPathGradientBlend = ctypes.windll.gdiplus.GdipSetPathGradientBlend
GdipSetPathGradientBlend.restype = ctypes.c_int
GdipSetPathGradientBlend.argtypes = [
ctypes.c_void_p, # brush : GpPathGradient* in/out
ctypes.POINTER(ctypes.c_float), # blend : FLOAT*
ctypes.POINTER(ctypes.c_float), # positions : FLOAT*
ctypes.c_int, # count : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipSetPathGradientBlend = Fiddle::Function.new(
lib['GdipSetPathGradientBlend'],
[
Fiddle::TYPE_VOIDP, # brush : GpPathGradient* in/out
Fiddle::TYPE_VOIDP, # blend : FLOAT*
Fiddle::TYPE_VOIDP, # positions : FLOAT*
Fiddle::TYPE_INT, # count : INT
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipSetPathGradientBlend(
brush: *mut GpPathGradient, // GpPathGradient* in/out
blend: *const f32, // FLOAT*
positions: *const f32, // FLOAT*
count: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipSetPathGradientBlend(IntPtr brush, ref float blend, ref float positions, int count);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetPathGradientBlend' -Namespace Win32 -PassThru
# $api::GdipSetPathGradientBlend(brush, blend, positions, count)#uselib "gdiplus.dll"
#func global GdipSetPathGradientBlend "GdipSetPathGradientBlend" sptr, sptr, sptr, sptr
; GdipSetPathGradientBlend varptr(brush), varptr(blend), varptr(positions), count ; 戻り値は stat
; brush : GpPathGradient* in/out -> "sptr"
; blend : FLOAT* -> "sptr"
; positions : FLOAT* -> "sptr"
; count : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipSetPathGradientBlend "GdipSetPathGradientBlend" var, var, var, int ; res = GdipSetPathGradientBlend(brush, blend, positions, count) ; brush : GpPathGradient* in/out -> "var" ; blend : FLOAT* -> "var" ; positions : FLOAT* -> "var" ; count : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipSetPathGradientBlend "GdipSetPathGradientBlend" sptr, sptr, sptr, int ; res = GdipSetPathGradientBlend(varptr(brush), varptr(blend), varptr(positions), count) ; brush : GpPathGradient* in/out -> "sptr" ; blend : FLOAT* -> "sptr" ; positions : FLOAT* -> "sptr" ; count : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipSetPathGradientBlend(GpPathGradient* brush, FLOAT* blend, FLOAT* positions, INT count) #uselib "gdiplus.dll" #cfunc global GdipSetPathGradientBlend "GdipSetPathGradientBlend" var, var, var, int ; res = GdipSetPathGradientBlend(brush, blend, positions, count) ; brush : GpPathGradient* in/out -> "var" ; blend : FLOAT* -> "var" ; positions : FLOAT* -> "var" ; count : INT -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipSetPathGradientBlend(GpPathGradient* brush, FLOAT* blend, FLOAT* positions, INT count) #uselib "gdiplus.dll" #cfunc global GdipSetPathGradientBlend "GdipSetPathGradientBlend" intptr, intptr, intptr, int ; res = GdipSetPathGradientBlend(varptr(brush), varptr(blend), varptr(positions), count) ; brush : GpPathGradient* in/out -> "intptr" ; blend : FLOAT* -> "intptr" ; positions : FLOAT* -> "intptr" ; count : INT -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipSetPathGradientBlend = gdiplus.NewProc("GdipSetPathGradientBlend")
)
// brush (GpPathGradient* in/out), blend (FLOAT*), positions (FLOAT*), count (INT)
r1, _, err := procGdipSetPathGradientBlend.Call(
uintptr(brush),
uintptr(blend),
uintptr(positions),
uintptr(count),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipSetPathGradientBlend(
brush: Pointer; // GpPathGradient* in/out
blend: Pointer; // FLOAT*
positions: Pointer; // FLOAT*
count: Integer // INT
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipSetPathGradientBlend';result := DllCall("gdiplus\GdipSetPathGradientBlend"
, "Ptr", brush ; GpPathGradient* in/out
, "Ptr", blend ; FLOAT*
, "Ptr", positions ; FLOAT*
, "Int", count ; INT
, "Int") ; return: Status●GdipSetPathGradientBlend(brush, blend, positions, count) = DLL("gdiplus.dll", "int GdipSetPathGradientBlend(void*, void*, void*, int)")
# 呼び出し: GdipSetPathGradientBlend(brush, blend, positions, count)
# brush : GpPathGradient* in/out -> "void*"
# blend : FLOAT* -> "void*"
# positions : FLOAT* -> "void*"
# count : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。