Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › GdipAddPathCurve3I

GdipAddPathCurve3I

関数
範囲と張力を指定してGDI+のパスにスプライン曲線を追加する(整数版)。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipAddPathCurve3I(
    GpPath* path,
    const Point* points,
    INT count,
    INT offset,
    INT numberOfSegments,
    FLOAT tension
);

パラメーター

名前方向
pathGpPath*inout
pointsPoint*in
countINTin
offsetINTin
numberOfSegmentsINTin
tensionFLOATin

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipAddPathCurve3I(
    GpPath* path,
    const Point* points,
    INT count,
    INT offset,
    INT numberOfSegments,
    FLOAT tension
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipAddPathCurve3I(
    IntPtr path,   // GpPath* in/out
    IntPtr points,   // Point*
    int count,   // INT
    int offset,   // INT
    int numberOfSegments,   // INT
    float tension   // FLOAT
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipAddPathCurve3I(
    path As IntPtr,   ' GpPath* in/out
    points As IntPtr,   ' Point*
    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 : Point*
' count : INT
' offset : INT
' numberOfSegments : INT
' tension : FLOAT
Declare PtrSafe Function GdipAddPathCurve3I 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

GdipAddPathCurve3I = ctypes.windll.gdiplus.GdipAddPathCurve3I
GdipAddPathCurve3I.restype = ctypes.c_int
GdipAddPathCurve3I.argtypes = [
    ctypes.c_void_p,  # path : GpPath* in/out
    ctypes.c_void_p,  # points : Point*
    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')
GdipAddPathCurve3I = Fiddle::Function.new(
  lib['GdipAddPathCurve3I'],
  [
    Fiddle::TYPE_VOIDP,  # path : GpPath* in/out
    Fiddle::TYPE_VOIDP,  # points : Point*
    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 GdipAddPathCurve3I(
        path: *mut GpPath,  // GpPath* in/out
        points: *const Point,  // Point*
        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 GdipAddPathCurve3I(IntPtr path, IntPtr points, int count, int offset, int numberOfSegments, float tension);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipAddPathCurve3I' -Namespace Win32 -PassThru
# $api::GdipAddPathCurve3I(path, points, count, offset, numberOfSegments, tension)
#uselib "gdiplus.dll"
#func global GdipAddPathCurve3I "GdipAddPathCurve3I" sptr, sptr, sptr, sptr, sptr, float
; GdipAddPathCurve3I varptr(path), varptr(points), count, offset, numberOfSegments, tension   ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; points : Point* -> "sptr"
; count : INT -> "sptr"
; offset : INT -> "sptr"
; numberOfSegments : INT -> "sptr"
; tension : FLOAT -> "float"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipAddPathCurve3I "GdipAddPathCurve3I" var, var, int, int, int, float
; res = GdipAddPathCurve3I(path, points, count, offset, numberOfSegments, tension)
; path : GpPath* in/out -> "var"
; points : Point* -> "var"
; count : INT -> "int"
; offset : INT -> "int"
; numberOfSegments : INT -> "int"
; tension : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipAddPathCurve3I(GpPath* path, Point* points, INT count, INT offset, INT numberOfSegments, FLOAT tension)
#uselib "gdiplus.dll"
#cfunc global GdipAddPathCurve3I "GdipAddPathCurve3I" var, var, int, int, int, float
; res = GdipAddPathCurve3I(path, points, count, offset, numberOfSegments, tension)
; path : GpPath* in/out -> "var"
; points : Point* -> "var"
; count : INT -> "int"
; offset : INT -> "int"
; numberOfSegments : INT -> "int"
; tension : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipAddPathCurve3I = gdiplus.NewProc("GdipAddPathCurve3I")
)

// path (GpPath* in/out), points (Point*), count (INT), offset (INT), numberOfSegments (INT), tension (FLOAT)
r1, _, err := procGdipAddPathCurve3I.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 GdipAddPathCurve3I(
  path: Pointer;   // GpPath* in/out
  points: Pointer;   // Point*
  count: Integer;   // INT
  offset: Integer;   // INT
  numberOfSegments: Integer;   // INT
  tension: Single   // FLOAT
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipAddPathCurve3I';
result := DllCall("gdiplus\GdipAddPathCurve3I"
    , "Ptr", path   ; GpPath* in/out
    , "Ptr", points   ; Point*
    , "Int", count   ; INT
    , "Int", offset   ; INT
    , "Int", numberOfSegments   ; INT
    , "Float", tension   ; FLOAT
    , "Int")   ; return: Status
●GdipAddPathCurve3I(path, points, count, offset, numberOfSegments, tension) = DLL("gdiplus.dll", "int GdipAddPathCurve3I(void*, void*, int, int, int, float)")
# 呼び出し: GdipAddPathCurve3I(path, points, count, offset, numberOfSegments, tension)
# path : GpPath* in/out -> "void*"
# points : Point* -> "void*"
# count : INT -> "int"
# offset : INT -> "int"
# numberOfSegments : INT -> "int"
# tension : FLOAT -> "float"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。