자료를 검색해보니
원하는 자료가 있어 해보고 있는데 계속 에러가 나오네요
워낙 이해를 잘 못하는지라 너그러히 봐주시고
어디서 잘못 되었는지 좀 짚어주세요 !
<!--CodeS-->
function Cam_ON(VideoCap:TVideoCap; biWidth_ ,biHeight_ :LongInt):string;
begin
try
if VideoCap.DriverOpen then VideoCap.DriverOpen:=False;
with VideoCap do begin
DriverIndex := DriverIndex_;
VideoFileName := '';
DriverOpen := True;
Videopreview := True;
CapToFile := false;
end;
//Cam_Format(VideoCap, biWidth_ , biHeight_, BI_RGB);
VideoCap.StartCapture;
except
raise Exception.Create('Cam Open Error');
end;
end;
<!--CodeE-->
<!--CodeS-->
function BIH_GetStride(BIH: TBitmapInfoHeader): Integer;
begin
Result := BIH.biWidth * BIH.biBitCount div 8;
end;
function BIH_GetSizeImage(BIH: TBitmapInfoHeader): DWORD;
begin
Result := BIH_GetStride(BIH) * BIH.biHeight * BIH.biPlanes;
end;
Function Cam_Format(VideoCap:TVideoCap; Width , Height: Integer; biCompression: DWORD) : Boolean;
var Vheader : TBitmapInfoHeader;
SetInfo : TBitmapInfoHeader;
begin
while VideoCap.StartCapture do begin
if VideoCap.StartCapture then
begin
//VideoCap.Videopreview := False;
//VideoCap.CapToFile := True;
VideoCap.StopCapture;
end;
if (VideoCap.StopCapture) and (VideoCap.CapToFile) then Break;
end;
if VideoCap.StopCapture then
begin
//Vheader := VideoCap.BitMapInfoHeader;
With Vheader do begin
biSize := Sizeof(TBITMAPINFOHEADER);
biWidth := Width;
biHeight := Height;
biPlanes := 1;
biBitCount := 23;
biCompression := biCompression;
//biSizeImage := ((biWidth * longint(biBitCount)) div 8) * biHeight;
//biSizeImage := BIH_GetSizeImage(Vheader);
biXPelsPerMeter:= 0;
biYPelsPerMeter:= 0;
biClrUsed := 0;
biClrImportant := 0;
end;
VideoCap.SetBitmapInfo( @Vheader, sizeof( TBitmapInfoHeader ) );
//capSetVideoFormat(VideoCap.fhcapWnd,@Vheader,sizeof(TBitmapInfoHeader));
end;
//VideoCap.Videopreview := True;
//VideoCap.CapToFile:=False;
VideoCap.StartCapture;
Result:= True;
end;
<!--CodeE-->
biBitCount := 23; 23은 없구요...
24일것 같군요.. ^^ 8,16,24,32,머.. 대충 이렇거든요..
한번.. 바꿔보세요..