Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Webcam Simple Program

Tags:

delphi

webcam

Can anyone help me to create a simple viewing of cam using just a simple TVideo component in delphi having a vid size of 160x120 only as default (no resize). Just a simple one. Please. Badly needed for my new project.

thanks.

like image 828
Tony Avatar asked Feb 21 '23 15:02

Tony


1 Answers

There are many ways to do it , I couldn't understand what do you mean by TVideo component but my solution can show image on a paintbox(any TCanvas)

use

http://www.delphibasics.info/home/delphibasicsprojects/directxdelphiwebcamcaptureexample/DirectXDelphiWebcamCapture.rar

this is a directX conversion to pascal made by [email protected]

add VSample.pas and VFrames.pas to your project

uses  VFrames;

procedure TForm6.Button1Click(Sender: TObject);

var
cam:TVideoImage;
strlst:TStringList;
begin

   strlst := TStringList.Create ;

   cam := TVideoImage.Create;
   cam.GetListOfDevices(strlst);

   cam.SetDisplayCanvas(PaintBox1.Canvas);
   cam.VideoStart(strlst.Strings[0])    ;//specify your cam by number
end;
like image 133
VibeeshanRC Avatar answered Mar 08 '23 17:03

VibeeshanRC