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