ホーム › Graphics.GdiPlus › GdipCreatePathGradient
GdipCreatePathGradient
関数点群を境界とするパスグラデーションブラシを作成する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipCreatePathGradient(
const PointF* points,
INT count,
WrapMode wrapMode,
GpPathGradient** polyGradient
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| points | PointF* | in |
| count | INT | in |
| wrapMode | WrapMode | in |
| polyGradient | GpPathGradient** | inout |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipCreatePathGradient(
const PointF* points,
INT count,
WrapMode wrapMode,
GpPathGradient** polyGradient
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipCreatePathGradient(
IntPtr points, // PointF*
int count, // INT
int wrapMode, // WrapMode
IntPtr polyGradient // GpPathGradient** in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipCreatePathGradient(
points As IntPtr, ' PointF*
count As Integer, ' INT
wrapMode As Integer, ' WrapMode
polyGradient As IntPtr ' GpPathGradient** in/out
) As Integer
End Function' points : PointF*
' count : INT
' wrapMode : WrapMode
' polyGradient : GpPathGradient** in/out
Declare PtrSafe Function GdipCreatePathGradient 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
GdipCreatePathGradient = ctypes.windll.gdiplus.GdipCreatePathGradient
GdipCreatePathGradient.restype = ctypes.c_int
GdipCreatePathGradient.argtypes = [
ctypes.c_void_p, # points : PointF*
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')
GdipCreatePathGradient = Fiddle::Function.new(
lib['GdipCreatePathGradient'],
[
Fiddle::TYPE_VOIDP, # points : PointF*
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 GdipCreatePathGradient(
points: *const PointF, // PointF*
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 GdipCreatePathGradient(IntPtr points, int count, int wrapMode, IntPtr polyGradient);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipCreatePathGradient' -Namespace Win32 -PassThru
# $api::GdipCreatePathGradient(points, count, wrapMode, polyGradient)#uselib "gdiplus.dll"
#func global GdipCreatePathGradient "GdipCreatePathGradient" sptr, sptr, sptr, sptr
; GdipCreatePathGradient varptr(points), count, wrapMode, varptr(polyGradient) ; 戻り値は stat
; points : PointF* -> "sptr"
; count : INT -> "sptr"
; wrapMode : WrapMode -> "sptr"
; polyGradient : GpPathGradient** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipCreatePathGradient "GdipCreatePathGradient" var, int, int, var ; res = GdipCreatePathGradient(points, count, wrapMode, polyGradient) ; points : PointF* -> "var" ; count : INT -> "int" ; wrapMode : WrapMode -> "int" ; polyGradient : GpPathGradient** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipCreatePathGradient "GdipCreatePathGradient" sptr, int, int, sptr ; res = GdipCreatePathGradient(varptr(points), count, wrapMode, varptr(polyGradient)) ; points : PointF* -> "sptr" ; count : INT -> "int" ; wrapMode : WrapMode -> "int" ; polyGradient : GpPathGradient** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipCreatePathGradient(PointF* points, INT count, WrapMode wrapMode, GpPathGradient** polyGradient) #uselib "gdiplus.dll" #cfunc global GdipCreatePathGradient "GdipCreatePathGradient" var, int, int, var ; res = GdipCreatePathGradient(points, count, wrapMode, polyGradient) ; points : PointF* -> "var" ; count : INT -> "int" ; wrapMode : WrapMode -> "int" ; polyGradient : GpPathGradient** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipCreatePathGradient(PointF* points, INT count, WrapMode wrapMode, GpPathGradient** polyGradient) #uselib "gdiplus.dll" #cfunc global GdipCreatePathGradient "GdipCreatePathGradient" intptr, int, int, intptr ; res = GdipCreatePathGradient(varptr(points), count, wrapMode, varptr(polyGradient)) ; points : PointF* -> "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")
procGdipCreatePathGradient = gdiplus.NewProc("GdipCreatePathGradient")
)
// points (PointF*), count (INT), wrapMode (WrapMode), polyGradient (GpPathGradient** in/out)
r1, _, err := procGdipCreatePathGradient.Call(
uintptr(points),
uintptr(count),
uintptr(wrapMode),
uintptr(polyGradient),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipCreatePathGradient(
points: Pointer; // PointF*
count: Integer; // INT
wrapMode: Integer; // WrapMode
polyGradient: Pointer // GpPathGradient** in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipCreatePathGradient';result := DllCall("gdiplus\GdipCreatePathGradient"
, "Ptr", points ; PointF*
, "Int", count ; INT
, "Int", wrapMode ; WrapMode
, "Ptr", polyGradient ; GpPathGradient** in/out
, "Int") ; return: Status●GdipCreatePathGradient(points, count, wrapMode, polyGradient) = DLL("gdiplus.dll", "int GdipCreatePathGradient(void*, int, int, void*)")
# 呼び出し: GdipCreatePathGradient(points, count, wrapMode, polyGradient)
# points : PointF* -> "void*"
# count : INT -> "int"
# wrapMode : WrapMode -> "int"
# polyGradient : GpPathGradient** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。