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