ホーム › Graphics.GdiPlus › GdipGetImageDecodersSize
GdipGetImageDecodersSize
関数利用可能な画像デコーダー数と必要なバッファサイズを取得する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipGetImageDecodersSize(
DWORD* numDecoders,
DWORD* size
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| numDecoders | DWORD* | out |
| size | DWORD* | out |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipGetImageDecodersSize(
DWORD* numDecoders,
DWORD* size
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipGetImageDecodersSize(
out uint numDecoders, // DWORD* out
out uint size // DWORD* out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipGetImageDecodersSize(
<Out> ByRef numDecoders As UInteger, ' DWORD* out
<Out> ByRef size As UInteger ' DWORD* out
) As Integer
End Function' numDecoders : DWORD* out
' size : DWORD* out
Declare PtrSafe Function GdipGetImageDecodersSize Lib "gdiplus" ( _
ByRef numDecoders As Long, _
ByRef size As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipGetImageDecodersSize = ctypes.windll.gdiplus.GdipGetImageDecodersSize
GdipGetImageDecodersSize.restype = ctypes.c_int
GdipGetImageDecodersSize.argtypes = [
ctypes.POINTER(wintypes.DWORD), # numDecoders : DWORD* out
ctypes.POINTER(wintypes.DWORD), # size : DWORD* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipGetImageDecodersSize = Fiddle::Function.new(
lib['GdipGetImageDecodersSize'],
[
Fiddle::TYPE_VOIDP, # numDecoders : DWORD* out
Fiddle::TYPE_VOIDP, # size : DWORD* out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipGetImageDecodersSize(
numDecoders: *mut u32, // DWORD* out
size: *mut u32 // DWORD* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipGetImageDecodersSize(out uint numDecoders, out uint size);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipGetImageDecodersSize' -Namespace Win32 -PassThru
# $api::GdipGetImageDecodersSize(numDecoders, size)#uselib "gdiplus.dll"
#func global GdipGetImageDecodersSize "GdipGetImageDecodersSize" sptr, sptr
; GdipGetImageDecodersSize varptr(numDecoders), varptr(size) ; 戻り値は stat
; numDecoders : DWORD* out -> "sptr"
; size : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipGetImageDecodersSize "GdipGetImageDecodersSize" var, var ; res = GdipGetImageDecodersSize(numDecoders, size) ; numDecoders : DWORD* out -> "var" ; size : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipGetImageDecodersSize "GdipGetImageDecodersSize" sptr, sptr ; res = GdipGetImageDecodersSize(varptr(numDecoders), varptr(size)) ; numDecoders : DWORD* out -> "sptr" ; size : DWORD* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipGetImageDecodersSize(DWORD* numDecoders, DWORD* size) #uselib "gdiplus.dll" #cfunc global GdipGetImageDecodersSize "GdipGetImageDecodersSize" var, var ; res = GdipGetImageDecodersSize(numDecoders, size) ; numDecoders : DWORD* out -> "var" ; size : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipGetImageDecodersSize(DWORD* numDecoders, DWORD* size) #uselib "gdiplus.dll" #cfunc global GdipGetImageDecodersSize "GdipGetImageDecodersSize" intptr, intptr ; res = GdipGetImageDecodersSize(varptr(numDecoders), varptr(size)) ; numDecoders : DWORD* out -> "intptr" ; size : DWORD* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipGetImageDecodersSize = gdiplus.NewProc("GdipGetImageDecodersSize")
)
// numDecoders (DWORD* out), size (DWORD* out)
r1, _, err := procGdipGetImageDecodersSize.Call(
uintptr(numDecoders),
uintptr(size),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipGetImageDecodersSize(
numDecoders: Pointer; // DWORD* out
size: Pointer // DWORD* out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipGetImageDecodersSize';result := DllCall("gdiplus\GdipGetImageDecodersSize"
, "Ptr", numDecoders ; DWORD* out
, "Ptr", size ; DWORD* out
, "Int") ; return: Status●GdipGetImageDecodersSize(numDecoders, size) = DLL("gdiplus.dll", "int GdipGetImageDecodersSize(void*, void*)")
# 呼び出し: GdipGetImageDecodersSize(numDecoders, size)
# numDecoders : DWORD* out -> "void*"
# size : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。