unit Unit4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, Psock, NMSTRM;

type
  TForm4 = class(TForm)
    Image1: TImage;
    NMStrmServ1: TNMStrmServ;
    procedure NMStrmServ1MSG(Sender: TComponent; const sFrom: String;
      strm: TStream);
    procedure Image1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}

procedure TForm4.NMStrmServ1MSG(Sender: TComponent; const sFrom: String;
  strm: TStream);  //прием изображения
var MyStream:TmemoryStream;
begin
MyStream:=TmemoryStream.Create();
MyStream.CopyFrom(strm,strm.Size);
myStream.Seek(0,soFromBeginning);
image1.Picture.Bitmap.LoadFromStream(MyStream);
MyStream.Free;
form4.Show;
end;

procedure TForm4.Image1Click(Sender: TObject);
begin
form4.Close;
end;

end.
