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