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