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

GdipGetPropertyIdList

関数
イメージのメタデータプロパティのID一覧を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPropertyIdList(
    GpImage* image,
    DWORD numOfProperty,
    DWORD* list
);

パラメーター

名前方向
imageGpImage*inout
numOfPropertyDWORDin
listDWORD*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

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

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPropertyIdList = gdiplus.NewProc("GdipGetPropertyIdList")
)

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