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

GdipGetPointCount

関数
GDI+のパスを構成する点の数を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPointCount(
    GpPath* path,
    INT* count
);

パラメーター

名前方向
pathGpPath*inout
countINT*inout

戻り値の型: Status

各言語での呼び出し定義

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

Status GdipGetPointCount(
    GpPath* path,
    INT* count
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetPointCount(
    IntPtr path,   // GpPath* in/out
    ref int count   // INT* in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetPointCount(
    path As IntPtr,   ' GpPath* in/out
    ByRef count As Integer   ' INT* in/out
) As Integer
End Function
' path : GpPath* in/out
' count : INT* in/out
Declare PtrSafe Function GdipGetPointCount Lib "gdiplus" ( _
    ByVal path As LongPtr, _
    ByRef count As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipGetPointCount = ctypes.windll.gdiplus.GdipGetPointCount
GdipGetPointCount.restype = ctypes.c_int
GdipGetPointCount.argtypes = [
    ctypes.c_void_p,  # path : GpPath* in/out
    ctypes.POINTER(ctypes.c_int),  # count : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipGetPointCount = Fiddle::Function.new(
  lib['GdipGetPointCount'],
  [
    Fiddle::TYPE_VOIDP,  # path : GpPath* in/out
    Fiddle::TYPE_VOIDP,  # count : INT* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipGetPointCount(
        path: *mut GpPath,  // GpPath* in/out
        count: *mut i32  // INT* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipGetPointCount(IntPtr path, ref int count);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetPointCount' -Namespace Win32 -PassThru
# $api::GdipGetPointCount(path, count)
#uselib "gdiplus.dll"
#func global GdipGetPointCount "GdipGetPointCount" sptr, sptr
; GdipGetPointCount varptr(path), varptr(count)   ; 戻り値は stat
; path : GpPath* in/out -> "sptr"
; count : INT* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipGetPointCount "GdipGetPointCount" var, var
; res = GdipGetPointCount(path, count)
; path : GpPath* in/out -> "var"
; count : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipGetPointCount(GpPath* path, INT* count)
#uselib "gdiplus.dll"
#cfunc global GdipGetPointCount "GdipGetPointCount" var, var
; res = GdipGetPointCount(path, count)
; path : GpPath* in/out -> "var"
; count : INT* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPointCount = gdiplus.NewProc("GdipGetPointCount")
)

// path (GpPath* in/out), count (INT* in/out)
r1, _, err := procGdipGetPointCount.Call(
	uintptr(path),
	uintptr(count),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipGetPointCount(
  path: Pointer;   // GpPath* in/out
  count: Pointer   // INT* in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipGetPointCount';
result := DllCall("gdiplus\GdipGetPointCount"
    , "Ptr", path   ; GpPath* in/out
    , "Ptr", count   ; INT* in/out
    , "Int")   ; return: Status
●GdipGetPointCount(path, count) = DLL("gdiplus.dll", "int GdipGetPointCount(void*, void*)")
# 呼び出し: GdipGetPointCount(path, count)
# path : GpPath* in/out -> "void*"
# count : INT* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。