ホーム › Web.InternetExplorer › DecodeImage
DecodeImage
関数ストリーム内の画像データをMIMEマップに従いデコードする。
シグネチャ
// ImgUtil.dll
#include <windows.h>
HRESULT DecodeImage(
IStream* pStream,
IMapMIMEToCLSID* pMap,
IUnknown* pEventSink
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pStream | IStream* | in |
| pMap | IMapMIMEToCLSID* | in |
| pEventSink | IUnknown* | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// ImgUtil.dll
#include <windows.h>
HRESULT DecodeImage(
IStream* pStream,
IMapMIMEToCLSID* pMap,
IUnknown* pEventSink
);[DllImport("ImgUtil.dll", ExactSpelling = true)]
static extern int DecodeImage(
IntPtr pStream, // IStream*
IntPtr pMap, // IMapMIMEToCLSID*
IntPtr pEventSink // IUnknown*
);<DllImport("ImgUtil.dll", ExactSpelling:=True)>
Public Shared Function DecodeImage(
pStream As IntPtr, ' IStream*
pMap As IntPtr, ' IMapMIMEToCLSID*
pEventSink As IntPtr ' IUnknown*
) As Integer
End Function' pStream : IStream*
' pMap : IMapMIMEToCLSID*
' pEventSink : IUnknown*
Declare PtrSafe Function DecodeImage Lib "imgutil" ( _
ByVal pStream As LongPtr, _
ByVal pMap As LongPtr, _
ByVal pEventSink As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DecodeImage = ctypes.windll.imgutil.DecodeImage
DecodeImage.restype = ctypes.c_int
DecodeImage.argtypes = [
ctypes.c_void_p, # pStream : IStream*
ctypes.c_void_p, # pMap : IMapMIMEToCLSID*
ctypes.c_void_p, # pEventSink : IUnknown*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ImgUtil.dll')
DecodeImage = Fiddle::Function.new(
lib['DecodeImage'],
[
Fiddle::TYPE_VOIDP, # pStream : IStream*
Fiddle::TYPE_VOIDP, # pMap : IMapMIMEToCLSID*
Fiddle::TYPE_VOIDP, # pEventSink : IUnknown*
],
Fiddle::TYPE_INT)#[link(name = "imgutil")]
extern "system" {
fn DecodeImage(
pStream: *mut core::ffi::c_void, // IStream*
pMap: *mut core::ffi::c_void, // IMapMIMEToCLSID*
pEventSink: *mut core::ffi::c_void // IUnknown*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ImgUtil.dll")]
public static extern int DecodeImage(IntPtr pStream, IntPtr pMap, IntPtr pEventSink);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ImgUtil_DecodeImage' -Namespace Win32 -PassThru
# $api::DecodeImage(pStream, pMap, pEventSink)#uselib "ImgUtil.dll"
#func global DecodeImage "DecodeImage" sptr, sptr, sptr
; DecodeImage pStream, pMap, pEventSink ; 戻り値は stat
; pStream : IStream* -> "sptr"
; pMap : IMapMIMEToCLSID* -> "sptr"
; pEventSink : IUnknown* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ImgUtil.dll"
#cfunc global DecodeImage "DecodeImage" sptr, sptr, sptr
; res = DecodeImage(pStream, pMap, pEventSink)
; pStream : IStream* -> "sptr"
; pMap : IMapMIMEToCLSID* -> "sptr"
; pEventSink : IUnknown* -> "sptr"; HRESULT DecodeImage(IStream* pStream, IMapMIMEToCLSID* pMap, IUnknown* pEventSink)
#uselib "ImgUtil.dll"
#cfunc global DecodeImage "DecodeImage" intptr, intptr, intptr
; res = DecodeImage(pStream, pMap, pEventSink)
; pStream : IStream* -> "intptr"
; pMap : IMapMIMEToCLSID* -> "intptr"
; pEventSink : IUnknown* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
imgutil = windows.NewLazySystemDLL("ImgUtil.dll")
procDecodeImage = imgutil.NewProc("DecodeImage")
)
// pStream (IStream*), pMap (IMapMIMEToCLSID*), pEventSink (IUnknown*)
r1, _, err := procDecodeImage.Call(
uintptr(pStream),
uintptr(pMap),
uintptr(pEventSink),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DecodeImage(
pStream: Pointer; // IStream*
pMap: Pointer; // IMapMIMEToCLSID*
pEventSink: Pointer // IUnknown*
): Integer; stdcall;
external 'ImgUtil.dll' name 'DecodeImage';result := DllCall("ImgUtil\DecodeImage"
, "Ptr", pStream ; IStream*
, "Ptr", pMap ; IMapMIMEToCLSID*
, "Ptr", pEventSink ; IUnknown*
, "Int") ; return: HRESULT●DecodeImage(pStream, pMap, pEventSink) = DLL("ImgUtil.dll", "int DecodeImage(void*, void*, void*)")
# 呼び出し: DecodeImage(pStream, pMap, pEventSink)
# pStream : IStream* -> "void*"
# pMap : IMapMIMEToCLSID* -> "void*"
# pEventSink : IUnknown* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。