ホーム › Media.Multimedia › ICDrawBegin
ICDrawBegin
関数映像フレームの描画準備を開始する。
シグネチャ
// MSVFW32.dll
#include <windows.h>
DWORD ICDrawBegin(
HIC hic,
DWORD dwFlags,
HPALETTE hpal, // optional
HWND hwnd, // optional
HDC hdc, // optional
INT xDst,
INT yDst,
INT dxDst,
INT dyDst,
BITMAPINFOHEADER* lpbi,
INT xSrc,
INT ySrc,
INT dxSrc,
INT dySrc,
DWORD dwRate,
DWORD dwScale
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hic | HIC | in |
| dwFlags | DWORD | in |
| hpal | HPALETTE | inoptional |
| hwnd | HWND | inoptional |
| hdc | HDC | inoptional |
| xDst | INT | in |
| yDst | INT | in |
| dxDst | INT | in |
| dyDst | INT | in |
| lpbi | BITMAPINFOHEADER* | in |
| xSrc | INT | in |
| ySrc | INT | in |
| dxSrc | INT | in |
| dySrc | INT | in |
| dwRate | DWORD | in |
| dwScale | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// MSVFW32.dll
#include <windows.h>
DWORD ICDrawBegin(
HIC hic,
DWORD dwFlags,
HPALETTE hpal, // optional
HWND hwnd, // optional
HDC hdc, // optional
INT xDst,
INT yDst,
INT dxDst,
INT dyDst,
BITMAPINFOHEADER* lpbi,
INT xSrc,
INT ySrc,
INT dxSrc,
INT dySrc,
DWORD dwRate,
DWORD dwScale
);[DllImport("MSVFW32.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern uint ICDrawBegin(
IntPtr hic, // HIC
uint dwFlags, // DWORD
IntPtr hpal, // HPALETTE optional
IntPtr hwnd, // HWND optional
IntPtr hdc, // HDC optional
int xDst, // INT
int yDst, // INT
int dxDst, // INT
int dyDst, // INT
IntPtr lpbi, // BITMAPINFOHEADER*
int xSrc, // INT
int ySrc, // INT
int dxSrc, // INT
int dySrc, // INT
uint dwRate, // DWORD
uint dwScale // DWORD
);<DllImport("MSVFW32.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function ICDrawBegin(
hic As IntPtr, ' HIC
dwFlags As UInteger, ' DWORD
hpal As IntPtr, ' HPALETTE optional
hwnd As IntPtr, ' HWND optional
hdc As IntPtr, ' HDC optional
xDst As Integer, ' INT
yDst As Integer, ' INT
dxDst As Integer, ' INT
dyDst As Integer, ' INT
lpbi As IntPtr, ' BITMAPINFOHEADER*
xSrc As Integer, ' INT
ySrc As Integer, ' INT
dxSrc As Integer, ' INT
dySrc As Integer, ' INT
dwRate As UInteger, ' DWORD
dwScale As UInteger ' DWORD
) As UInteger
End Function' hic : HIC
' dwFlags : DWORD
' hpal : HPALETTE optional
' hwnd : HWND optional
' hdc : HDC optional
' xDst : INT
' yDst : INT
' dxDst : INT
' dyDst : INT
' lpbi : BITMAPINFOHEADER*
' xSrc : INT
' ySrc : INT
' dxSrc : INT
' dySrc : INT
' dwRate : DWORD
' dwScale : DWORD
Declare PtrSafe Function ICDrawBegin Lib "msvfw32" ( _
ByVal hic As LongPtr, _
ByVal dwFlags As Long, _
ByVal hpal As LongPtr, _
ByVal hwnd As LongPtr, _
ByVal hdc As LongPtr, _
ByVal xDst As Long, _
ByVal yDst As Long, _
ByVal dxDst As Long, _
ByVal dyDst As Long, _
ByVal lpbi As LongPtr, _
ByVal xSrc As Long, _
ByVal ySrc As Long, _
ByVal dxSrc As Long, _
ByVal dySrc As Long, _
ByVal dwRate As Long, _
ByVal dwScale As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ICDrawBegin = ctypes.cdll.msvfw32.ICDrawBegin
ICDrawBegin.restype = wintypes.DWORD
ICDrawBegin.argtypes = [
wintypes.HANDLE, # hic : HIC
wintypes.DWORD, # dwFlags : DWORD
wintypes.HANDLE, # hpal : HPALETTE optional
wintypes.HANDLE, # hwnd : HWND optional
wintypes.HANDLE, # hdc : HDC optional
ctypes.c_int, # xDst : INT
ctypes.c_int, # yDst : INT
ctypes.c_int, # dxDst : INT
ctypes.c_int, # dyDst : INT
ctypes.c_void_p, # lpbi : BITMAPINFOHEADER*
ctypes.c_int, # xSrc : INT
ctypes.c_int, # ySrc : INT
ctypes.c_int, # dxSrc : INT
ctypes.c_int, # dySrc : INT
wintypes.DWORD, # dwRate : DWORD
wintypes.DWORD, # dwScale : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSVFW32.dll')
ICDrawBegin = Fiddle::Function.new(
lib['ICDrawBegin'],
[
Fiddle::TYPE_VOIDP, # hic : HIC
-Fiddle::TYPE_INT, # dwFlags : DWORD
Fiddle::TYPE_VOIDP, # hpal : HPALETTE optional
Fiddle::TYPE_VOIDP, # hwnd : HWND optional
Fiddle::TYPE_VOIDP, # hdc : HDC optional
Fiddle::TYPE_INT, # xDst : INT
Fiddle::TYPE_INT, # yDst : INT
Fiddle::TYPE_INT, # dxDst : INT
Fiddle::TYPE_INT, # dyDst : INT
Fiddle::TYPE_VOIDP, # lpbi : BITMAPINFOHEADER*
Fiddle::TYPE_INT, # xSrc : INT
Fiddle::TYPE_INT, # ySrc : INT
Fiddle::TYPE_INT, # dxSrc : INT
Fiddle::TYPE_INT, # dySrc : INT
-Fiddle::TYPE_INT, # dwRate : DWORD
-Fiddle::TYPE_INT, # dwScale : DWORD
],
-Fiddle::TYPE_INT, Fiddle::Function::CDECL)#[link(name = "msvfw32")]
extern "C" {
fn ICDrawBegin(
hic: *mut core::ffi::c_void, // HIC
dwFlags: u32, // DWORD
hpal: *mut core::ffi::c_void, // HPALETTE optional
hwnd: *mut core::ffi::c_void, // HWND optional
hdc: *mut core::ffi::c_void, // HDC optional
xDst: i32, // INT
yDst: i32, // INT
dxDst: i32, // INT
dyDst: i32, // INT
lpbi: *mut BITMAPINFOHEADER, // BITMAPINFOHEADER*
xSrc: i32, // INT
ySrc: i32, // INT
dxSrc: i32, // INT
dySrc: i32, // INT
dwRate: u32, // DWORD
dwScale: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSVFW32.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ICDrawBegin(IntPtr hic, uint dwFlags, IntPtr hpal, IntPtr hwnd, IntPtr hdc, int xDst, int yDst, int dxDst, int dyDst, IntPtr lpbi, int xSrc, int ySrc, int dxSrc, int dySrc, uint dwRate, uint dwScale);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_ICDrawBegin' -Namespace Win32 -PassThru
# $api::ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale)#uselib "MSVFW32.dll"
#func global ICDrawBegin "ICDrawBegin" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ICDrawBegin hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, varptr(lpbi), xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale ; 戻り値は stat
; hic : HIC -> "sptr"
; dwFlags : DWORD -> "sptr"
; hpal : HPALETTE optional -> "sptr"
; hwnd : HWND optional -> "sptr"
; hdc : HDC optional -> "sptr"
; xDst : INT -> "sptr"
; yDst : INT -> "sptr"
; dxDst : INT -> "sptr"
; dyDst : INT -> "sptr"
; lpbi : BITMAPINFOHEADER* -> "sptr"
; xSrc : INT -> "sptr"
; ySrc : INT -> "sptr"
; dxSrc : INT -> "sptr"
; dySrc : INT -> "sptr"
; dwRate : DWORD -> "sptr"
; dwScale : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MSVFW32.dll" #cfunc global ICDrawBegin "ICDrawBegin" sptr, int, sptr, sptr, sptr, int, int, int, int, var, int, int, int, int, int, int ; res = ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale) ; hic : HIC -> "sptr" ; dwFlags : DWORD -> "int" ; hpal : HPALETTE optional -> "sptr" ; hwnd : HWND optional -> "sptr" ; hdc : HDC optional -> "sptr" ; xDst : INT -> "int" ; yDst : INT -> "int" ; dxDst : INT -> "int" ; dyDst : INT -> "int" ; lpbi : BITMAPINFOHEADER* -> "var" ; xSrc : INT -> "int" ; ySrc : INT -> "int" ; dxSrc : INT -> "int" ; dySrc : INT -> "int" ; dwRate : DWORD -> "int" ; dwScale : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MSVFW32.dll" #cfunc global ICDrawBegin "ICDrawBegin" sptr, int, sptr, sptr, sptr, int, int, int, int, sptr, int, int, int, int, int, int ; res = ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, varptr(lpbi), xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale) ; hic : HIC -> "sptr" ; dwFlags : DWORD -> "int" ; hpal : HPALETTE optional -> "sptr" ; hwnd : HWND optional -> "sptr" ; hdc : HDC optional -> "sptr" ; xDst : INT -> "int" ; yDst : INT -> "int" ; dxDst : INT -> "int" ; dyDst : INT -> "int" ; lpbi : BITMAPINFOHEADER* -> "sptr" ; xSrc : INT -> "int" ; ySrc : INT -> "int" ; dxSrc : INT -> "int" ; dySrc : INT -> "int" ; dwRate : DWORD -> "int" ; dwScale : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ICDrawBegin(HIC hic, DWORD dwFlags, HPALETTE hpal, HWND hwnd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, BITMAPINFOHEADER* lpbi, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, DWORD dwRate, DWORD dwScale) #uselib "MSVFW32.dll" #cfunc global ICDrawBegin "ICDrawBegin" intptr, int, intptr, intptr, intptr, int, int, int, int, var, int, int, int, int, int, int ; res = ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale) ; hic : HIC -> "intptr" ; dwFlags : DWORD -> "int" ; hpal : HPALETTE optional -> "intptr" ; hwnd : HWND optional -> "intptr" ; hdc : HDC optional -> "intptr" ; xDst : INT -> "int" ; yDst : INT -> "int" ; dxDst : INT -> "int" ; dyDst : INT -> "int" ; lpbi : BITMAPINFOHEADER* -> "var" ; xSrc : INT -> "int" ; ySrc : INT -> "int" ; dxSrc : INT -> "int" ; dySrc : INT -> "int" ; dwRate : DWORD -> "int" ; dwScale : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ICDrawBegin(HIC hic, DWORD dwFlags, HPALETTE hpal, HWND hwnd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, BITMAPINFOHEADER* lpbi, INT xSrc, INT ySrc, INT dxSrc, INT dySrc, DWORD dwRate, DWORD dwScale) #uselib "MSVFW32.dll" #cfunc global ICDrawBegin "ICDrawBegin" intptr, int, intptr, intptr, intptr, int, int, int, int, intptr, int, int, int, int, int, int ; res = ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, varptr(lpbi), xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale) ; hic : HIC -> "intptr" ; dwFlags : DWORD -> "int" ; hpal : HPALETTE optional -> "intptr" ; hwnd : HWND optional -> "intptr" ; hdc : HDC optional -> "intptr" ; xDst : INT -> "int" ; yDst : INT -> "int" ; dxDst : INT -> "int" ; dyDst : INT -> "int" ; lpbi : BITMAPINFOHEADER* -> "intptr" ; xSrc : INT -> "int" ; ySrc : INT -> "int" ; dxSrc : INT -> "int" ; dySrc : INT -> "int" ; dwRate : DWORD -> "int" ; dwScale : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
procICDrawBegin = msvfw32.NewProc("ICDrawBegin")
)
// hic (HIC), dwFlags (DWORD), hpal (HPALETTE optional), hwnd (HWND optional), hdc (HDC optional), xDst (INT), yDst (INT), dxDst (INT), dyDst (INT), lpbi (BITMAPINFOHEADER*), xSrc (INT), ySrc (INT), dxSrc (INT), dySrc (INT), dwRate (DWORD), dwScale (DWORD)
r1, _, err := procICDrawBegin.Call(
uintptr(hic),
uintptr(dwFlags),
uintptr(hpal),
uintptr(hwnd),
uintptr(hdc),
uintptr(xDst),
uintptr(yDst),
uintptr(dxDst),
uintptr(dyDst),
uintptr(lpbi),
uintptr(xSrc),
uintptr(ySrc),
uintptr(dxSrc),
uintptr(dySrc),
uintptr(dwRate),
uintptr(dwScale),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ICDrawBegin(
hic: THandle; // HIC
dwFlags: DWORD; // DWORD
hpal: THandle; // HPALETTE optional
hwnd: THandle; // HWND optional
hdc: THandle; // HDC optional
xDst: Integer; // INT
yDst: Integer; // INT
dxDst: Integer; // INT
dyDst: Integer; // INT
lpbi: Pointer; // BITMAPINFOHEADER*
xSrc: Integer; // INT
ySrc: Integer; // INT
dxSrc: Integer; // INT
dySrc: Integer; // INT
dwRate: DWORD; // DWORD
dwScale: DWORD // DWORD
): DWORD; cdecl;
external 'MSVFW32.dll' name 'ICDrawBegin';result := DllCall("MSVFW32\ICDrawBegin"
, "Ptr", hic ; HIC
, "UInt", dwFlags ; DWORD
, "Ptr", hpal ; HPALETTE optional
, "Ptr", hwnd ; HWND optional
, "Ptr", hdc ; HDC optional
, "Int", xDst ; INT
, "Int", yDst ; INT
, "Int", dxDst ; INT
, "Int", dyDst ; INT
, "Ptr", lpbi ; BITMAPINFOHEADER*
, "Int", xSrc ; INT
, "Int", ySrc ; INT
, "Int", dxSrc ; INT
, "Int", dySrc ; INT
, "UInt", dwRate ; DWORD
, "UInt", dwScale ; DWORD
, "Cdecl UInt") ; return: DWORD●ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale) = DLL("MSVFW32.dll", "dword ICDrawBegin(void*, dword, void*, void*, void*, int, int, int, int, void*, int, int, int, int, dword, dword)")
# 呼び出し: ICDrawBegin(hic, dwFlags, hpal, hwnd, hdc, xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale)
# hic : HIC -> "void*"
# dwFlags : DWORD -> "dword"
# hpal : HPALETTE optional -> "void*"
# hwnd : HWND optional -> "void*"
# hdc : HDC optional -> "void*"
# xDst : INT -> "int"
# yDst : INT -> "int"
# dxDst : INT -> "int"
# dyDst : INT -> "int"
# lpbi : BITMAPINFOHEADER* -> "void*"
# xSrc : INT -> "int"
# ySrc : INT -> "int"
# dxSrc : INT -> "int"
# dySrc : INT -> "int"
# dwRate : DWORD -> "dword"
# dwScale : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。