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

GdipDrawCurve2I

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

シグネチャ

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

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

パラメーター

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

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipDrawCurve2I = ctypes.windll.gdiplus.GdipDrawCurve2I
GdipDrawCurve2I.restype = ctypes.c_int
GdipDrawCurve2I.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_float,  # tension : FLOAT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipDrawCurve2I = Fiddle::Function.new(
  lib['GdipDrawCurve2I'],
  [
    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_FLOAT,  # tension : FLOAT
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipDrawCurve2I(
        graphics: *mut GpGraphics,  // GpGraphics* in/out
        pen: *mut GpPen,  // GpPen* 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 GdipDrawCurve2I(IntPtr graphics, IntPtr pen, IntPtr points, int count, float tension);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipDrawCurve2I' -Namespace Win32 -PassThru
# $api::GdipDrawCurve2I(graphics, pen, points, count, tension)
#uselib "gdiplus.dll"
#func global GdipDrawCurve2I "GdipDrawCurve2I" sptr, sptr, sptr, sptr, float
; GdipDrawCurve2I varptr(graphics), varptr(pen), varptr(points), count, tension   ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; pen : GpPen* in/out -> "sptr"
; points : Point* -> "sptr"
; count : INT -> "sptr"
; tension : FLOAT -> "float"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipDrawCurve2I "GdipDrawCurve2I" var, var, var, int, float
; res = GdipDrawCurve2I(graphics, pen, points, count, tension)
; graphics : GpGraphics* in/out -> "var"
; pen : GpPen* in/out -> "var"
; points : Point* -> "var"
; count : INT -> "int"
; tension : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipDrawCurve2I(GpGraphics* graphics, GpPen* pen, Point* points, INT count, FLOAT tension)
#uselib "gdiplus.dll"
#cfunc global GdipDrawCurve2I "GdipDrawCurve2I" var, var, var, int, float
; res = GdipDrawCurve2I(graphics, pen, points, count, tension)
; graphics : GpGraphics* in/out -> "var"
; pen : GpPen* in/out -> "var"
; points : Point* -> "var"
; count : INT -> "int"
; tension : FLOAT -> "float"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"math"
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipDrawCurve2I = gdiplus.NewProc("GdipDrawCurve2I")
)

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