ホーム › Graphics.GdiPlus › GdipGetPropertyItem
GdipGetPropertyItem
関数指定したIDのメタデータプロパティ項目を取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetPropertyItem(
GpImage* image,
DWORD propId,
DWORD propSize,
PropertyItem* buffer
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| image | GpImage* | inout |
| propId | DWORD | in |
| propSize | DWORD | in |
| buffer | PropertyItem* | 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 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetPropertyItem "GdipGetPropertyItem" sptr, int, int, sptr ; res = GdipGetPropertyItem(varptr(image), propId, propSize, varptr(buffer)) ; image : GpImage* in/out -> "sptr" ; propId : DWORD -> "int" ; propSize : DWORD -> "int" ; buffer : PropertyItem* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; Status GdipGetPropertyItem(GpImage* image, DWORD propId, DWORD propSize, PropertyItem* buffer) #uselib "gdiplus.dll" #cfunc global GdipGetPropertyItem "GdipGetPropertyItem" intptr, int, int, intptr ; res = GdipGetPropertyItem(varptr(image), propId, propSize, varptr(buffer)) ; image : GpImage* in/out -> "intptr" ; propId : DWORD -> "int" ; propSize : DWORD -> "int" ; buffer : PropertyItem* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // Statusfunction 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)。