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