VideoFrm.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:2k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit VideoFrm;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ExtCtrls,ChatingFrm,Global, Menus,RealMessengerUnit;
  6. type
  7.   TVideoForm = class(TForm)
  8.     procedure FormCreate(Sender: TObject);
  9.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  10.     procedure FormShow(Sender: TObject);
  11.   private
  12.     { Private declarations }
  13.   public
  14.     ChatingForm:TChatingForm;
  15.     VideoHandShake:TVideoHandShake;
  16.   end;
  17. var
  18.   VideoForm: TVideoForm;
  19. implementation
  20. {$R *.dfm}
  21. procedure TVideoForm.FormCreate(Sender: TObject);
  22. begin
  23.   DoubleBuffered:=True;
  24. end;
  25. procedure TVideoForm.FormClose(Sender: TObject; var Action: TCloseAction);
  26. begin
  27.   if PEmployee(ChatingForm.TVUserList.Items.GetFirstNode.Data).HaveVideoDevice then
  28.   begin
  29.     if (ChatingForm.Width-ChatingForm.PnlLeftTop.Width<ChatingForm.PnlYourCamera.Width) then ChatingForm.PnlLeftTop.Width:=ChatingForm.PnlLeftTop.Width - ChatingForm.PnlYourCamera.Width - 2;
  30.     ChatingForm.PnlYourCamera.Show;
  31.   end;
  32.   Action:=caFree;
  33.   if VideoHandShake<>nil then VideoHandShake.PDC:=GetDC(ChatingForm.AviPanelOut.Handle);
  34.   SetStretchBltMode(VideoHandShake.PDC,HALFTONE);
  35.   VideoForm:=nil;
  36. end;
  37. procedure TVideoForm.FormShow(Sender: TObject);
  38. begin
  39.   if PEmployee(ChatingForm.TVUserList.Items.GetFirstNode.Data).HaveVideoDevice then
  40.   begin
  41.     if (ChatingForm.Width-ChatingForm.PnlLeftTop.Width>ChatingForm.PnlYourCamera.Width) then ChatingForm.PnlLeftTop.Width:=ChatingForm.PnlLeftTop.Width + ChatingForm.PnlYourCamera.Width + 2;
  42.     ChatingForm.PnlYourCamera.Hide;
  43.   end;
  44. end;
  45. end.