G
gaoren
Unregistered / Unconfirmed
GUEST, unregistred user!
麻烦大家帮我看一下这个程序,我不知道为什么 nmudp1.SendStream(strr);这句老是有问题
procedure TForm1.BitBtn1Click(Sender: TObject);
var
bmp1:tbitmap;
bmp1canvas:tcanvas;
dc:HDC;
c:string;
begin
strr:=tmemorystream.Create;
bmp1:=tbitmap.Create;
bmp1.Height:=screen.Height;
bmp1.Width:=screen.Width;
dc:=getDC(0);
bmp1canvas:=tcanvas.Create;
bmp1canvas.handle:=dc;
bmp1.Canvas.CopyRect(rect(0,0,bmp1.Width,bmp1.height),bmp1canvas,rect(0,0,screen.Width ,screen.Height));
bmp1canvas.free;
//Form1.Canvas.Draw(0,0,Bmp1);
image1.Picture.Bitmap :=bmp1;
bmp1.SaveToStream(strr);
nmudp1.RemoteHost:='192.168.0.5';
nmudp1.RemotePort :=1024;
nmudp1.SendStream(strr);
strr.Free;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
bmp1:tbitmap;
bmp1canvas:tcanvas;
dc:HDC;
c:string;
begin
strr:=tmemorystream.Create;
bmp1:=tbitmap.Create;
bmp1.Height:=screen.Height;
bmp1.Width:=screen.Width;
dc:=getDC(0);
bmp1canvas:=tcanvas.Create;
bmp1canvas.handle:=dc;
bmp1.Canvas.CopyRect(rect(0,0,bmp1.Width,bmp1.height),bmp1canvas,rect(0,0,screen.Width ,screen.Height));
bmp1canvas.free;
//Form1.Canvas.Draw(0,0,Bmp1);
image1.Picture.Bitmap :=bmp1;
bmp1.SaveToStream(strr);
nmudp1.RemoteHost:='192.168.0.5';
nmudp1.RemotePort :=1024;
nmudp1.SendStream(strr);
strr.Free;
end;