Home > Back-end >  Video chat program error, can't run, please advice in detail, and gives the detailed solution,
Video chat program error, can't run, please advice in detail, and gives the detailed solution,

Time:10-27

USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdUDPServer IdBaseComponent, IdComponent IdUDPBase, IdUDPClient,
StdCtrls ExtCtrls, Jpeg, VFW, IdSocketHandle;

Type
TForm1=class (TForm)
Panel1: TPanel;
Panel2: TPanel;
Image1: TImage;
For: TButton;
Button2: TButton;
Button3: TButton;
IdUDPClient1: TIdUDPClient;
IdUDPServer1: TIdUDPServer;
Procedure Button1Click (Sender: TObject);
Procedure Button2Click (Sender: TObject);
Procedure Button3Click (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;

Var
Form1: TForm1;

CapWnd: THandle;
CapParms: TcaptureParms;
BMPINFO: TBitmapInfo;

Implementation

{$R *. DFM}

The function FrameCallBack (hWnd: hWnd; LpVHdr: PVIDEOHDR) : LongInt; Stdcall;
Var
Hd: Thandle;
JPG: TJpegImage;
MemStream: TMemoryStream;
Bitmap: TBitmap;


The begin
Bitmap:=TBitmap. Create;
Bitmap. Width:=BMPINFO. BmiHeader. BiWidth;
Bitmap. Height:=BMPINFO. BmiHeader. BiHeight;

Hd:=DrawDibOpen;
DrawDibDraw (hd, Bitmap. Canvas. Handle, 0, 0, BMPINFO. BmiHeader. Biwidth,
BMPINFO. Bmiheader. Biheight, @ BMPINFO bmiheader,
LpVHdr ^. LpData, 0, 0, BMPINFO bmiHeader. BiWidth, BMPINFO. BmiHeader. Biheight, 0);
DrawDibClose (hd);
MemStream:=TMemoryStream. Create;
JPG:=TJpegImage. Create;
JPG. Assign (Bitmap);
Jpg.Com pressionQuality:=20;
JPG. JPEGNeeded;
Jpg.Com press;
JPG. SaveToStream (memStream);
JPG. Free;
Form1. IdUDPClient1. BroadcastEnabled:=true;
If memStream. Size> Form1. IdUDPClient1. BufferSize then
Form1. IdUDPClient1. SendBuffer
(' 192.168.1.255 ', 9001, memStream. Memory ^, Form1. IdUDPClient1. BufferSize)
The else
Form1. IdUDPClient1. SendBuffer
(' 192.168.1.255 ', 9001, memStream. Memory ^, memStream. Size);
MemStream. Free;
Bitmap. Free;
end;
.

Execute the "Form1. IdUDPClient1. SendBuffer (192.168.1.255 ', 9001, memStream. ^ Memory, Form1 IdUDPClient1. BufferSize)
"Error is unable to continue," [DCC Error] server1. Pas (87) : E2250 There is no overloaded version of 'SendBuffer' that can be called with these arguments, "

CodePudding user response:

Indy version is wrong

CodePudding user response:

Compile error?
Indy version is wrong, the parameters of the function

CodePudding user response:

Thank s11ss!!!
Thank sz_haitao!!!
Has been solved, I was using a 2010 edition,

CodePudding user response:

Ask is how to solve? thank you

CodePudding user response:

I also use delphi2010, the same questions, thank you for prompt.
  • Related