ホーム › Graphics.GdiPlus › GdipGetPropertyIdList
GdipGetPropertyIdList
関数イメージのメタデータプロパティのID一覧を取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetPropertyIdList(
GpImage* image,
DWORD numOfProperty,
DWORD* list
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| image | GpImage* | inout | 対象となるGDI+画像オブジェクトへのポインタ。 |
| numOfProperty | DWORD | in | 取得するプロパティID数。事前にGdipGetPropertyCountで得た件数を渡す。 |
| list | DWORD* | inout | プロパティID(DWORD)の配列を受け取る出力先バッファへのポインタ。 |
戻り値の型: 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 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetPropertyIdList "GdipGetPropertyIdList" sptr, int, sptr ; res = GdipGetPropertyIdList(varptr(image), numOfProperty, varptr(list)) ; image : GpImage* in/out -> "sptr" ; numOfProperty : DWORD -> "int" ; list : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; Status GdipGetPropertyIdList(GpImage* image, DWORD numOfProperty, DWORD* list) #uselib "gdiplus.dll" #cfunc global GdipGetPropertyIdList "GdipGetPropertyIdList" intptr, int, intptr ; res = GdipGetPropertyIdList(varptr(image), numOfProperty, varptr(list)) ; image : GpImage* in/out -> "intptr" ; numOfProperty : DWORD -> "int" ; list : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // Statusfunction 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)。const std = @import("std");
extern "gdiplus" fn GdipGetPropertyIdList(
image: [*c]GpImage, // GpImage* in/out
numOfProperty: u32, // DWORD
list: [*c]u32 // DWORD* in/out
) callconv(std.os.windows.WINAPI) i32;proc GdipGetPropertyIdList(
image: ptr GpImage, # GpImage* in/out
numOfProperty: uint32, # DWORD
list: ptr uint32 # DWORD* in/out
): int32 {.importc: "GdipGetPropertyIdList", stdcall, dynlib: "gdiplus.dll".}pragma(lib, "gdiplus");
extern(Windows)
int GdipGetPropertyIdList(
GpImage* image, // GpImage* in/out
uint numOfProperty, // DWORD
uint* list // DWORD* in/out
);ccall((:GdipGetPropertyIdList, "gdiplus.dll"), stdcall, Int32,
(Ptr{GpImage}, UInt32, Ptr{UInt32}),
image, numOfProperty, list)
# image : GpImage* in/out -> Ptr{GpImage}
# numOfProperty : DWORD -> UInt32
# list : DWORD* in/out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GdipGetPropertyIdList(
void* image,
uint32_t numOfProperty,
uint32_t* list);
]]
local gdiplus = ffi.load("gdiplus")
-- gdiplus.GdipGetPropertyIdList(image, numOfProperty, list)
-- image : GpImage* in/out
-- numOfProperty : DWORD
-- list : DWORD* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('gdiplus.dll');
const GdipGetPropertyIdList = lib.func('__stdcall', 'GdipGetPropertyIdList', 'int32_t', ['void *', 'uint32_t', 'uint32_t *']);
// GdipGetPropertyIdList(image, numOfProperty, list)
// image : GpImage* in/out -> 'void *'
// numOfProperty : DWORD -> 'uint32_t'
// list : DWORD* in/out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("gdiplus.dll", {
GdipGetPropertyIdList: { parameters: ["pointer", "u32", "pointer"], result: "i32" },
});
// lib.symbols.GdipGetPropertyIdList(image, numOfProperty, list)
// image : GpImage* in/out -> "pointer"
// numOfProperty : DWORD -> "u32"
// list : DWORD* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GdipGetPropertyIdList(
void* image,
uint32_t numOfProperty,
uint32_t* list);
C, "gdiplus.dll");
// $ffi->GdipGetPropertyIdList(image, numOfProperty, list);
// image : GpImage* in/out
// numOfProperty : DWORD
// list : DWORD* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Gdiplus extends StdCallLibrary {
Gdiplus INSTANCE = Native.load("gdiplus", Gdiplus.class);
int GdipGetPropertyIdList(
Pointer image, // GpImage* in/out
int numOfProperty, // DWORD
IntByReference list // DWORD* in/out
);
}@[Link("gdiplus")]
lib Libgdiplus
fun GdipGetPropertyIdList = GdipGetPropertyIdList(
image : GpImage*, # GpImage* in/out
numOfProperty : UInt32, # DWORD
list : UInt32* # DWORD* in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GdipGetPropertyIdListNative = Int32 Function(Pointer<Void>, Uint32, Pointer<Uint32>);
typedef GdipGetPropertyIdListDart = int Function(Pointer<Void>, int, Pointer<Uint32>);
final GdipGetPropertyIdList = DynamicLibrary.open('gdiplus.dll')
.lookupFunction<GdipGetPropertyIdListNative, GdipGetPropertyIdListDart>('GdipGetPropertyIdList');
// image : GpImage* in/out -> Pointer<Void>
// numOfProperty : DWORD -> Uint32
// list : DWORD* in/out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GdipGetPropertyIdList(
image: Pointer; // GpImage* in/out
numOfProperty: DWORD; // DWORD
list: Pointer // DWORD* in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipGetPropertyIdList';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GdipGetPropertyIdList"
c_GdipGetPropertyIdList :: Ptr () -> Word32 -> Ptr Word32 -> IO Int32
-- image : GpImage* in/out -> Ptr ()
-- numOfProperty : DWORD -> Word32
-- list : DWORD* in/out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let gdipgetpropertyidlist =
foreign "GdipGetPropertyIdList"
((ptr void) @-> uint32_t @-> (ptr uint32_t) @-> returning int32_t)
(* image : GpImage* in/out -> (ptr void) *)
(* numOfProperty : DWORD -> uint32_t *)
(* list : DWORD* in/out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library gdiplus (t "gdiplus.dll"))
(cffi:use-foreign-library gdiplus)
(cffi:defcfun ("GdipGetPropertyIdList" gdip-get-property-id-list :convention :stdcall) :int32
(image :pointer) ; GpImage* in/out
(num-of-property :uint32) ; DWORD
(list :pointer)) ; DWORD* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GdipGetPropertyIdList = Win32::API::More->new('gdiplus',
'int GdipGetPropertyIdList(LPVOID image, DWORD numOfProperty, LPVOID list)');
# my $ret = $GdipGetPropertyIdList->Call($image, $numOfProperty, $list);
# image : GpImage* in/out -> LPVOID
# numOfProperty : DWORD -> DWORD
# list : DWORD* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。