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

GdipGetPropertySize

関数
全プロパティの合計バッファサイズと個数を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPropertySize(
    GpImage* image,
    DWORD* totalBufferSize,
    DWORD* numProperties
);

パラメーター

名前方向
imageGpImage*inout
totalBufferSizeDWORD*inout
numPropertiesDWORD*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPropertySize = ctypes.windll.gdiplus.GdipGetPropertySize
GdipGetPropertySize.restype = ctypes.c_int
GdipGetPropertySize.argtypes = [
    ctypes.c_void_p,  # image : GpImage* in/out
    ctypes.POINTER(wintypes.DWORD),  # totalBufferSize : DWORD* in/out
    ctypes.POINTER(wintypes.DWORD),  # numProperties : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPropertySize = gdiplus.NewProc("GdipGetPropertySize")
)

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