📄 vfw.pas
字号:
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_SET_SCALE,WPARAM(f), 0));
end;
function capGetStatus(hwnd:THandle; s:PCapStatus; wSize:Word):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_GET_STATUS, WPARAM(wSize),LPARAM(s)));
end;
function capSetScrollPos(hwnd:THandle; lpP:pPoint):Boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_SET_SCROLL, 0, LParam(lpP)));
end;
function capGrabFrame(hwnd:THandle):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_GRAB_FRAME, 0, 0));
end;
function capGrabFrameNoStop(hwnd:THandle):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_GRAB_FRAME_NOSTOP, 0, 0));
end;
function capCaptureSequence(hwnd:THandle):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_SEQUENCE, 0, 0));
end;
function capCaptureSequenceNoFile(hwnd:THandle):boolean;
begin
Result :=Boolean(SendMessage(hwnd, WM_CAP_SEQUENCE_NOFILE, 0, 0));
end;
function capCaptureStop(hwnd:THandle):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_STOP, 0, 0));
end;
function capCaptureAbort(hwnd:THandle):Boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_ABORT, 0, 0));
end;
function capCaptureSingleFrameOpen(hwnd:THandle):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_SINGLE_FRAME_OPEN, 0, 0));
end;
function capCaptureSingleFrameClose(hwnd:THandle):boolean ;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_SINGLE_FRAME_CLOSE, 0, 0));
end;
function capCaptureSingleFrame(hwnd:THandle):boolean;
begin
Result :=Boolean(SendMessage(hwnd, WM_CAP_SINGLE_FRAME, 0, 0));
end;
function capCaptureGetSetup(hwnd:THandle; s:pCaptureParms; wSize:Word):boolean;
begin
Result :=Boolean( SendMessage(hwnd, WM_CAP_GET_SEQUENCE_SETUP, WPARAM(wSize),LPARAM(s)));
end;
function capCaptureSetSetup(hwnd:THandle; s:pCaptureParms; wSize:Word):boolean;
begin
Result := Boolean (SendMessage(hwnd, WM_CAP_SET_SEQUENCE_SETUP, WParam(wSize),LParam(s)));
end;
function capSetMCIDeviceName(hwnd:THandle; szName:Pchar):Boolean;
begin
Result :=Boolean( SendMessage(hwnd, WM_CAP_SET_MCI_DEVICE, 0, LParam(szName)));
end;
function capGetMCIDeviceName(hwnd:THandle; szName:Pchar; wSize:Word):Boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_GET_MCI_DEVICE, Wparam(wSize), LPARAM(szName)));
end;
function capPaletteOpen(hwnd:THandle; szName:PChar):Boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_PAL_OPEN, 0, LParam(szName)));
end;
function capPaletteSave(hwnd:THandle; szName:PChar):boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_PAL_SAVE, 0,LParam(szName)));
end;
function capPalettePaste(hwnd:THandle):Boolean;
begin
Result :=Boolean( SendMessage(hwnd, WM_CAP_PAL_PASTE, 0, 0));
end;
function capPaletteAuto(hwnd:THandle; iFrames:Word; iColors:word):Boolean;
begin
Result :=Boolean( SendMessage(hwnd, WM_CAP_PAL_AUTOCREATE, WPARAM(iFrames),LPARAM(iColors)));
end;
function capPaletteManual(hwnd:THandle; fGrab:Word; iColors:word):Boolean;
begin
Result := Boolean(SendMessage(hwnd, WM_CAP_PAL_MANUALCREATE, WPARAM(fGrab),LPARAM(iColors)));
end;
{== DrawDib functions ========================================================}
{-- DrawDibOpen() ------------------------------------------------------------}
function DrawDibOpen: HDRAWDIB; stdcall; external VFWDLL;
{-- DrawDibClose() -----------------------------------------------------------}
function DrawDibClose(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
{-- DrawDibGetBuffer() -------------------------------------------------------}
function DrawDibGetBuffer(hdd: HDRAWDIB; lpbi: PBITMAPINFOHEADER; dwSize: DWORD; dwFlags: DWORD): Pointer; stdcall; external VFWDLL;
{-- DrawDibGetPalette() - get the palette used for drawing DIBs --------------}
function DrawDibGetPalette(hdd: HDRAWDIB): HPALETTE; stdcall; external VFWDLL;
{-- DrawDibSetPalette() - set the palette used for drawing DIBs --------------}
function DrawDibSetPalette(hdd: HDRAWDIB; hpal: HPALETTE): BOOL; stdcall; external VFWDLL;
{-- DrawDibChangePalette() ---------------------------------------------------}
function DrawDibChangePalette(hdd: HDRAWDIB; iStart, iLen: integer; lppe: PPALETTEENTRY): BOOL; stdcall; external VFWDLL;
{-- DrawDibRealize() - realize the palette in a HDD --------------------------}
function DrawDibRealize(hdd: HDRAWDIB; hdc: HDC; fBackground: BOOL): UINT; stdcall; external VFWDLL;
{-- DrawDibStart() - start of streaming playback -----------------------------}
function DrawDibStart(hdd: HDRAWDIB; rate: DWORD): BOOL; stdcall; external VFWDLL;
{-- DrawDibStop() - start of streaming playback ------------------------------}
function DrawDibStop(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
{-- DrawDibBegin() - prepare to draw -----------------------------------------}
function DrawDibBegin(
hdd : HDRAWDIB;
hdc : HDC;
dxDst : integer;
dyDst : integer;
lpbi : PBITMAPINFOHEADER;
dxSrc : integer;
dySrc : integer;
wFlags : UINT
): BOOL; stdcall; external VFWDLL;
{-- DrawDibDraw() - actually draw a DIB to the screen ------------------------}
function DrawDibDraw(
hdd : HDRAWDIB;
hdc : HDC;
xDst : integer;
yDst : integer;
dxDst : integer;
dyDst : integer;
lpbi : PBITMAPINFOHEADER;
lpBits : Pointer;
xSrc : integer;
ySrc : integer;
dxSrc : integer;
dySrc : integer;
wFlags : UINT
): BOOL; stdcall; external VFWDLL;
{-- DrawDibEnd() -------------------------------------------------------------}
function DrawDibEnd(hdd: HDRAWDIB): BOOL; stdcall; external VFWDLL;
{-- DrawDibTime() - for debugging purposes only ------------------------------}
function DrawDibTime(hdd: HDRAWDIB; lpddtime: PDRAWDIBTIME): BOOL; stdcall; external VFWDLL;
{-- Display profiling --------------------------------------------------------}
function DrawDibProfileDisplay(lpbi: PBITMAPINFOHEADER): DWORD; stdcall; external VFWDLL;
// Installable Compression Manager
function MKFOURCC( ch0, ch1, ch2, ch3: Char ): FOURCC;
begin
Result := (DWord(Ord(ch0))) or
(DWord(Ord(ch1)) shl 8) or
(DWord(Ord(ch2)) shl 16) or
(DWord(Ord(ch3)) shl 24);
end;
function mmioFOURCC( ch0, ch1, ch2, ch3: Char ): FOURCC;
begin
Result := MKFOURCC(ch0,ch1,ch2,ch3);
end;
function aviTWOCC(ch0, ch1: Char): TWOCC;
begin
Result := (Word(Ord(ch0))) or
(Word(Ord(ch1)) shl 8);
end;
{-- Query macros -------------------------------------------------------------}
function ICQueryAbout(hic: HIC): BOOL;
begin
Result := ICSendMessage(hic, ICM_ABOUT, -1, ICMF_ABOUT_QUERY) = ICERR_OK;
end;
function ICAbout(hic: HIC; hwnd: HWND): DWORD;
begin
Result := ICSendMessage(hic, ICM_ABOUT, hwnd, 0);
end;
function ICQueryConfigure(hic: HIC): BOOL;
begin
Result := ICSendMessage(hic, ICM_CONFIGURE, -1, ICMF_CONFIGURE_QUERY) = ICERR_OK;
end;
function ICConfigure(hic: HIC; hwnd: HWND): DWORD;
begin
Result := ICSendMessage(hic, ICM_CONFIGURE, hwnd, 0);
end;
{-- Get/Set state macros -----------------------------------------------------}
function ICGetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
begin
Result := ICSendMessage(hic, ICM_GETSTATE, DWORD(pv), cb);
end;
function ICSetState(hic: HIC; pv: Pointer; cb: DWORD): DWORD;
begin
Result := ICSendMessage(hic, ICM_SETSTATE, DWORD(pv), cb);
end;
function ICGetStateSize(hic: HIC): DWORD;
begin
Result := ICGetState(hic, nil, 0);
end;
{-- Get value macros ---------------------------------------------------------}
function ICGetDefaultQuality(hic: HIC): DWORD;
begin
ICSendMessage(hic, ICM_GETDEFAULTQUALITY, DWORD(@Result), sizeof(Result));
end;
function ICGetDefaultKeyFrameRate(hic: HIC): DWORD;
begin
ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, DWORD(@Result), sizeof(Result));
end;
{-- Draw window macro --------------------------------------------------------}
function ICDrawWindow(hic: HIC; prc: PRECT): DWORD;
begin
Result := ICSendMessage(hic, ICM_DRAW_WINDOW, DWORD(prc), sizeof(prc^));
end;
{-- ICCompressBegin() - start compression from a source fmt to a dest fmt ----}
function ICCompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_COMPRESS_BEGIN, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
{-- ICCompressQuery() - determines if compression from src to dst is supp ----}
function ICCompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_COMPRESS_QUERY, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
{-- ICCompressGetFormat() - get the output format (fmt of compressed) --------}
// if lpbiOutput is nil return the size in bytes needed for format.
function ICCompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_COMPRESS_GET_FORMAT, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
function ICCompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
begin
Result := ICCompressGetFormat(hic, lpbi, nil);
end;
{-- ICCompressSize() - return the maximal size of a compressed frame ---------}
function ICCompressGetSize(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_COMPRESS_GET_SIZE, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
function ICCompressEnd(hic: HIC): DWORD;
begin
Result := ICSendMessage(hic, ICM_COMPRESS_END, 0, 0);
end;
{-- ICDecompressBegin() - start compression from src fmt to a dest fmt -------}
function ICDecompressBegin(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_BEGIN, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
{-- ICDecompressQuery() - determines if compression is supported -------------}
function ICDecompressQuery(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_QUERY, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
{-- ICDecompressGetFormat - get the output fmt (fmt of uncompressed data) ----}
// if lpbiOutput is NULL return the size in bytes needed for format.
function ICDecompressGetFormat(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_GET_FORMAT, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
function ICDecompressGetFormatSize(hic: HIC; lpbi: PBITMAPINFOHEADER): DWORD;
begin
Result := ICDecompressGetFormat(hic, lpbi, nil);
end;
{-- ICDecompressGetPalette() - get the output palette ------------------------}
function ICDecompressGetPalette(hic: HIC; lpbiInput, lpbiOutput: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_GET_PALETTE, DWORD(lpbiInput), DWORD(lpbiOutput));
end;
function ICDecompressSetPalette(hic: HIC; lpbiPalette: PBITMAPINFOHEADER): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_SET_PALETTE, DWORD(lpbiPalette), 0);
end;
function ICDecompressEnd(hic: HIC): DWORD;
begin
Result := ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0);
end;
{-- ICM function declarations ------------------------------------------------}
function ICInfo(fccType, fccHandler: DWORD; lpicinfo: PICINFO) : BOOL ; stdcall ; external VFWDLL;
function ICInstall(fccType, fccHandler: DWORD; lParam: LPARAM; szDesc: LPSTR; wFlags: UINT) : BOOL ; stdcall ; external VFWDLL;
function ICRemove(fccType, fccHandler: DWORD; wFlags: UINT) : BOOL ; stdcall ; external VFWDLL;
function ICGetInfo(hic: HIC; picinfo: PICINFO; cb: DWORD) : DWORD ; stdcall ; external VFWDLL;
function ICOpen(fccType, fccHandler: DWORD; wMode: UINT) : HIC ; stdcall ; external VFWDLL;
function ICOpenFunction(fccType, fccHandler: DWORD; wMode: UINT; lpfnHandler: TFarProc) : HIC ; stdcall ; external VFWDLL;
function ICClose(hic: HIC) : DWORD ; stdcall ; external VFWDLL;
function ICSendMessage(hic: HIC; msg: UINT; dw1, dw2: integer) : DWORD ; stdcall ; external VFWDLL;
{== Compression functions ====
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -