Win32 API 日本語リファレンス
ホームMedia.Multimedia › ICDraw

ICDraw

関数
圧縮映像フレームを伸張して画面に描画する。
DLLMSVFW32.dll呼出規約cdecl対応OSWindows 2000 以降

シグネチャ

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

DWORD ICDraw(
    HIC hic,
    DWORD dwFlags,
    void* lpFormat,
    void* lpData,   // optional
    DWORD cbData,
    INT lTime
);

パラメーター

名前方向
hicHICin
dwFlagsDWORDin
lpFormatvoid*in
lpDatavoid*inoptional
cbDataDWORDin
lTimeINTin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ICDraw(
    HIC hic,
    DWORD dwFlags,
    void* lpFormat,
    void* lpData,   // optional
    DWORD cbData,
    INT lTime
);
[DllImport("MSVFW32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ICDraw(
    IntPtr hic,   // HIC
    uint dwFlags,   // DWORD
    IntPtr lpFormat,   // void*
    IntPtr lpData,   // void* optional
    uint cbData,   // DWORD
    int lTime   // INT
);
<DllImport("MSVFW32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ICDraw(
    hic As IntPtr,   ' HIC
    dwFlags As UInteger,   ' DWORD
    lpFormat As IntPtr,   ' void*
    lpData As IntPtr,   ' void* optional
    cbData As UInteger,   ' DWORD
    lTime As Integer   ' INT
) As UInteger
End Function
' hic : HIC
' dwFlags : DWORD
' lpFormat : void*
' lpData : void* optional
' cbData : DWORD
' lTime : INT
Declare PtrSafe Function ICDraw Lib "msvfw32" ( _
    ByVal hic As LongPtr, _
    ByVal dwFlags As Long, _
    ByVal lpFormat As LongPtr, _
    ByVal lpData As LongPtr, _
    ByVal cbData As Long, _
    ByVal lTime As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ICDraw = ctypes.cdll.msvfw32.ICDraw
ICDraw.restype = wintypes.DWORD
ICDraw.argtypes = [
    wintypes.HANDLE,  # hic : HIC
    wintypes.DWORD,  # dwFlags : DWORD
    ctypes.POINTER(None),  # lpFormat : void*
    ctypes.POINTER(None),  # lpData : void* optional
    wintypes.DWORD,  # cbData : DWORD
    ctypes.c_int,  # lTime : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSVFW32.dll')
ICDraw = Fiddle::Function.new(
  lib['ICDraw'],
  [
    Fiddle::TYPE_VOIDP,  # hic : HIC
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
    Fiddle::TYPE_VOIDP,  # lpFormat : void*
    Fiddle::TYPE_VOIDP,  # lpData : void* optional
    -Fiddle::TYPE_INT,  # cbData : DWORD
    Fiddle::TYPE_INT,  # lTime : INT
  ],
  -Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "msvfw32")]
extern "C" {
    fn ICDraw(
        hic: *mut core::ffi::c_void,  // HIC
        dwFlags: u32,  // DWORD
        lpFormat: *mut (),  // void*
        lpData: *mut (),  // void* optional
        cbData: u32,  // DWORD
        lTime: i32  // INT
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSVFW32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ICDraw(IntPtr hic, uint dwFlags, IntPtr lpFormat, IntPtr lpData, uint cbData, int lTime);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_ICDraw' -Namespace Win32 -PassThru
# $api::ICDraw(hic, dwFlags, lpFormat, lpData, cbData, lTime)
#uselib "MSVFW32.dll"
#func global ICDraw "ICDraw" sptr, sptr, sptr, sptr, sptr, sptr
; ICDraw hic, dwFlags, lpFormat, lpData, cbData, lTime   ; 戻り値は stat
; hic : HIC -> "sptr"
; dwFlags : DWORD -> "sptr"
; lpFormat : void* -> "sptr"
; lpData : void* optional -> "sptr"
; cbData : DWORD -> "sptr"
; lTime : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSVFW32.dll"
#cfunc global ICDraw "ICDraw" sptr, int, sptr, sptr, int, int
; res = ICDraw(hic, dwFlags, lpFormat, lpData, cbData, lTime)
; hic : HIC -> "sptr"
; dwFlags : DWORD -> "int"
; lpFormat : void* -> "sptr"
; lpData : void* optional -> "sptr"
; cbData : DWORD -> "int"
; lTime : INT -> "int"
; DWORD ICDraw(HIC hic, DWORD dwFlags, void* lpFormat, void* lpData, DWORD cbData, INT lTime)
#uselib "MSVFW32.dll"
#cfunc global ICDraw "ICDraw" intptr, int, intptr, intptr, int, int
; res = ICDraw(hic, dwFlags, lpFormat, lpData, cbData, lTime)
; hic : HIC -> "intptr"
; dwFlags : DWORD -> "int"
; lpFormat : void* -> "intptr"
; lpData : void* optional -> "intptr"
; cbData : DWORD -> "int"
; lTime : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
	procICDraw = msvfw32.NewProc("ICDraw")
)

// hic (HIC), dwFlags (DWORD), lpFormat (void*), lpData (void* optional), cbData (DWORD), lTime (INT)
r1, _, err := procICDraw.Call(
	uintptr(hic),
	uintptr(dwFlags),
	uintptr(lpFormat),
	uintptr(lpData),
	uintptr(cbData),
	uintptr(lTime),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ICDraw(
  hic: THandle;   // HIC
  dwFlags: DWORD;   // DWORD
  lpFormat: Pointer;   // void*
  lpData: Pointer;   // void* optional
  cbData: DWORD;   // DWORD
  lTime: Integer   // INT
): DWORD; cdecl;
  external 'MSVFW32.dll' name 'ICDraw';
result := DllCall("MSVFW32\ICDraw"
    , "Ptr", hic   ; HIC
    , "UInt", dwFlags   ; DWORD
    , "Ptr", lpFormat   ; void*
    , "Ptr", lpData   ; void* optional
    , "UInt", cbData   ; DWORD
    , "Int", lTime   ; INT
    , "Cdecl UInt")   ; return: DWORD
●ICDraw(hic, dwFlags, lpFormat, lpData, cbData, lTime) = DLL("MSVFW32.dll", "dword ICDraw(void*, dword, void*, void*, dword, int)")
# 呼び出し: ICDraw(hic, dwFlags, lpFormat, lpData, cbData, lTime)
# hic : HIC -> "void*"
# dwFlags : DWORD -> "dword"
# lpFormat : void* -> "void*"
# lpData : void* optional -> "void*"
# cbData : DWORD -> "dword"
# lTime : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。