Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › GdipLoadImageFromStreamICM

GdipLoadImageFromStreamICM

関数
色補正を適用しつつストリームから画像を読み込む。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipLoadImageFromStreamICM(
    IStream* stream,
    GpImage** image
);

パラメーター

名前方向
streamIStream*in
imageGpImage**inout

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipLoadImageFromStreamICM(
    IStream* stream,
    GpImage** image
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipLoadImageFromStreamICM(
    IntPtr stream,   // IStream*
    IntPtr image   // GpImage** in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipLoadImageFromStreamICM(
    stream As IntPtr,   ' IStream*
    image As IntPtr   ' GpImage** in/out
) As Integer
End Function
' stream : IStream*
' image : GpImage** in/out
Declare PtrSafe Function GdipLoadImageFromStreamICM Lib "gdiplus" ( _
    ByVal stream As LongPtr, _
    ByVal image As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipLoadImageFromStreamICM = ctypes.windll.gdiplus.GdipLoadImageFromStreamICM
GdipLoadImageFromStreamICM.restype = ctypes.c_int
GdipLoadImageFromStreamICM.argtypes = [
    ctypes.c_void_p,  # stream : IStream*
    ctypes.c_void_p,  # image : GpImage** in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipLoadImageFromStreamICM = Fiddle::Function.new(
  lib['GdipLoadImageFromStreamICM'],
  [
    Fiddle::TYPE_VOIDP,  # stream : IStream*
    Fiddle::TYPE_VOIDP,  # image : GpImage** in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipLoadImageFromStreamICM(
        stream: *mut core::ffi::c_void,  // IStream*
        image: *mut *mut GpImage  // GpImage** in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipLoadImageFromStreamICM(IntPtr stream, IntPtr image);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipLoadImageFromStreamICM' -Namespace Win32 -PassThru
# $api::GdipLoadImageFromStreamICM(stream, image)
#uselib "gdiplus.dll"
#func global GdipLoadImageFromStreamICM "GdipLoadImageFromStreamICM" sptr, sptr
; GdipLoadImageFromStreamICM stream, varptr(image)   ; 戻り値は stat
; stream : IStream* -> "sptr"
; image : GpImage** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipLoadImageFromStreamICM "GdipLoadImageFromStreamICM" sptr, var
; res = GdipLoadImageFromStreamICM(stream, image)
; stream : IStream* -> "sptr"
; image : GpImage** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipLoadImageFromStreamICM(IStream* stream, GpImage** image)
#uselib "gdiplus.dll"
#cfunc global GdipLoadImageFromStreamICM "GdipLoadImageFromStreamICM" intptr, var
; res = GdipLoadImageFromStreamICM(stream, image)
; stream : IStream* -> "intptr"
; image : GpImage** in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipLoadImageFromStreamICM = gdiplus.NewProc("GdipLoadImageFromStreamICM")
)

// stream (IStream*), image (GpImage** in/out)
r1, _, err := procGdipLoadImageFromStreamICM.Call(
	uintptr(stream),
	uintptr(image),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipLoadImageFromStreamICM(
  stream: Pointer;   // IStream*
  image: Pointer   // GpImage** in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipLoadImageFromStreamICM';
result := DllCall("gdiplus\GdipLoadImageFromStreamICM"
    , "Ptr", stream   ; IStream*
    , "Ptr", image   ; GpImage** in/out
    , "Int")   ; return: Status
●GdipLoadImageFromStreamICM(stream, image) = DLL("gdiplus.dll", "int GdipLoadImageFromStreamICM(void*, void*)")
# 呼び出し: GdipLoadImageFromStreamICM(stream, image)
# stream : IStream* -> "void*"
# image : GpImage** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。