扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:佚名 来源:天极开发 2007年10月31日
关键字:
IdUDPServer1.DefaultPort:=9001; //接收端口 IdUDPServer1.Active:=true; //启用 |
var jpg:TJpegImage;begin try jpg := TJpegImage.Create; jpg.LoadFromStream(Adata); Image1.Picture.Bitmap.Assign(jpg); jpg.Free; exceptend;end; |
unit Unit2; interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer, ExtCtrls,jpeg,IdSocketHandle; type TForm1 = class(TForm) Image1: TImage; IdUDPServer1: TIdUDPServer; Button1: TButton; procedure Button1Click(Sender: TObject); procedure IdUDPServer1UDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject); begin IdUDPServer1.DefaultPort:=9001; //接收端口 IdUDPServer1.Active:=true; //启用 end; procedure TForm1.IdUDPServer1UDPRead(Sender: TObject;AData: TStream; ABinding: TIdSocketHandle); var jpg:TJpegImage; begin try jpg := TJpegImage.Create; jpg.LoadFromStream(Adata); Image1.Picture.Bitmap.Assign(jpg); jpg.Free; except end; end; end. |
![]() 视频聊天软件服务器 |
![]() 聊天软件客户端 |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。