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

GdipGetPropertyItem

関数
指定したIDのメタデータプロパティ項目を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetPropertyItem(
    GpImage* image,
    DWORD propId,
    DWORD propSize,
    PropertyItem* buffer
);

パラメーター

名前方向
imageGpImage*inout
propIdDWORDin
propSizeDWORDin
bufferPropertyItem*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetPropertyItem = ctypes.windll.gdiplus.GdipGetPropertyItem
GdipGetPropertyItem.restype = ctypes.c_int
GdipGetPropertyItem.argtypes = [
    ctypes.c_void_p,  # image : GpImage* in/out
    wintypes.DWORD,  # propId : DWORD
    wintypes.DWORD,  # propSize : DWORD
    ctypes.c_void_p,  # buffer : PropertyItem* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetPropertyItem = gdiplus.NewProc("GdipGetPropertyItem")
)

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