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

GdipDrawCurve3I

関数
区間と張力を指定して整数座標の基数スプライン曲線を描画する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipDrawCurve3I(
    GpGraphics* graphics,
    GpPen* pen,
    const Point* points,
    INT count,
    INT offset,
    INT numberOfSegments,
    FLOAT tension
);

パラメーター

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

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipDrawCurve3I(
    GpGraphics* graphics,
    GpPen* pen,
    const Point* points,
    INT count,
    INT offset,
    INT numberOfSegments,
    FLOAT tension
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipDrawCurve3I(
    IntPtr graphics,   // GpGraphics* in/out
    IntPtr pen,   // GpPen* 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 GdipDrawCurve3I(
    graphics As IntPtr,   ' GpGraphics* in/out
    pen As IntPtr,   ' GpPen* 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
' graphics : GpGraphics* in/out
' pen : GpPen* in/out
' points : Point*
' count : INT
' offset : INT
' numberOfSegments : INT
' tension : FLOAT
Declare PtrSafe Function GdipDrawCurve3I Lib "gdiplus" ( _
    ByVal graphics As LongPtr, _
    ByVal pen 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

GdipDrawCurve3I = ctypes.windll.gdiplus.GdipDrawCurve3I
GdipDrawCurve3I.restype = ctypes.c_int
GdipDrawCurve3I.argtypes = [
    ctypes.c_void_p,  # graphics : GpGraphics* in/out
    ctypes.c_void_p,  # pen : GpPen* 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')
GdipDrawCurve3I = Fiddle::Function.new(
  lib['GdipDrawCurve3I'],
  [
    Fiddle::TYPE_VOIDP,  # graphics : GpGraphics* in/out
    Fiddle::TYPE_VOIDP,  # pen : GpPen* 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 GdipDrawCurve3I(
        graphics: *mut GpGraphics,  // GpGraphics* in/out
        pen: *mut GpPen,  // GpPen* 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 GdipDrawCurve3I(IntPtr graphics, IntPtr pen, IntPtr points, int count, int offset, int numberOfSegments, float tension);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipDrawCurve3I' -Namespace Win32 -PassThru
# $api::GdipDrawCurve3I(graphics, pen, points, count, offset, numberOfSegments, tension)
#uselib "gdiplus.dll"
#func global GdipDrawCurve3I "GdipDrawCurve3I" sptr, sptr, sptr, sptr, sptr, sptr, float
; GdipDrawCurve3I varptr(graphics), varptr(pen), varptr(points), count, offset, numberOfSegments, tension   ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; pen : GpPen* 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 GdipDrawCurve3I "GdipDrawCurve3I" var, var, var, int, int, int, float
; res = GdipDrawCurve3I(graphics, pen, points, count, offset, numberOfSegments, tension)
; graphics : GpGraphics* in/out -> "var"
; pen : GpPen* in/out -> "var"
; points : Point* -> "var"
; count : INT -> "int"
; offset : INT -> "int"
; numberOfSegments : INT -> "int"
; tension : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipDrawCurve3I(GpGraphics* graphics, GpPen* pen, Point* points, INT count, INT offset, INT numberOfSegments, FLOAT tension)
#uselib "gdiplus.dll"
#cfunc global GdipDrawCurve3I "GdipDrawCurve3I" var, var, var, int, int, int, float
; res = GdipDrawCurve3I(graphics, pen, points, count, offset, numberOfSegments, tension)
; graphics : GpGraphics* in/out -> "var"
; pen : GpPen* 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")
	procGdipDrawCurve3I = gdiplus.NewProc("GdipDrawCurve3I")
)

// graphics (GpGraphics* in/out), pen (GpPen* in/out), points (Point*), count (INT), offset (INT), numberOfSegments (INT), tension (FLOAT)
r1, _, err := procGdipDrawCurve3I.Call(
	uintptr(graphics),
	uintptr(pen),
	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 GdipDrawCurve3I(
  graphics: Pointer;   // GpGraphics* in/out
  pen: Pointer;   // GpPen* in/out
  points: Pointer;   // Point*
  count: Integer;   // INT
  offset: Integer;   // INT
  numberOfSegments: Integer;   // INT
  tension: Single   // FLOAT
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipDrawCurve3I';
result := DllCall("gdiplus\GdipDrawCurve3I"
    , "Ptr", graphics   ; GpGraphics* in/out
    , "Ptr", pen   ; GpPen* in/out
    , "Ptr", points   ; Point*
    , "Int", count   ; INT
    , "Int", offset   ; INT
    , "Int", numberOfSegments   ; INT
    , "Float", tension   ; FLOAT
    , "Int")   ; return: Status
●GdipDrawCurve3I(graphics, pen, points, count, offset, numberOfSegments, tension) = DLL("gdiplus.dll", "int GdipDrawCurve3I(void*, void*, void*, int, int, int, float)")
# 呼び出し: GdipDrawCurve3I(graphics, pen, points, count, offset, numberOfSegments, tension)
# graphics : GpGraphics* in/out -> "void*"
# pen : GpPen* 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)。