<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 6  文章 - 129  trackbacks - 0
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    常用鏈接

    留言簿(14)

    隨筆檔案(6)

    文章分類(467)

    文章檔案(423)

    相冊

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 825681
    • 排名 - 49

    最新評論

    閱讀排行榜

    評論排行榜

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ImgList, Menus, ExtCtrls, BmpRgn,  StdCtrls, IniFiles,
      Buttons;

    type
      TForm1 = class(TForm)
        img1: TImage;
        bvl1: TBevel;
        lbl1: TLabel;
        procedure FormCreate(Sender: TObject);
      private
        { Private declarations }
        procedure WMEraseBkGnd( Var Msg: TWMEraseBkGnd ); message WM_ERASEBKGND;
        procedure WMNCHitTest( Var msg: TWMNCHitTest ); message WM_NCHITTEST;
      public
        { Public declarations }
        procedure SetTheRegion;
        procedure AppException(Sender: TObject; E: Exception);
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}
    // This routine takes care of drawing the bitmap on the form.
    procedure TForm1.WMEraseBkGnd(var Msg: TWMEraseBkGnd);
    var
      Brush: TBrush;
    begin
      Brush := TBrush.Create;
      Brush.Color := Color;
      FillRect( Msg.DC, ClientRect, Brush.Handle);
      Brush.Free;
      with img1.Picture.Bitmap do
        BitBlt( Msg.DC, 0, 0, Width, Height, Canvas.Handle, 0, 0, SRCCOPY);
      Msg.Result := 1;
    end;

    // This routine takes care of letting the user move the form
    // around on the desktop.
    procedure TForm1.WMNCHitTest( var msg: TWMNCHitTest );
    var
      i: integer;
      p: TPoint;
      AControl: TControl;
      MouseOnControl: boolean;
    begin
      inherited;
      if msg.result = HTCLIENT then begin
        p.x := msg.XPos;
        p.y := msg.YPos;
        p := ScreenToClient( p);
        MouseOnControl := false;
        for i := 0 to ControlCount-1 do begin
          if not MouseOnControl
          then begin
            AControl := Controls[i];
            if ((AControl is TWinControl) or (AControl is TGraphicControl))
              and (AControl.Visible) then
            begin
                 MouseOnControl := PtInRect( AControl.BoundsRect, p);
            end;
          end
          else
            break;
        end;
        if (not MouseOnControl) then
          msg.Result := HTCAPTION;
      end;
    end;

    procedure TForm1.SetTheRegion;
    var
      HR: HRGN;
    begin
      HR := BmpToRegion( Self, img1.Picture.Bitmap);
      SetWindowRgn( handle, HR, true);
      Invalidate;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
        Application.OnException := AppException;
        SetTheRegion;
    end;

    procedure TForm1.AppException(Sender: TObject; E: Exception);
    begin
      Application.ProcessMessages;
      Application.ShowException(E);
      Application.Terminate;
    end;

    end.
    注意:
    (1) img1: TImage;的Visible屬性必須設置為false

    (2) BmpRgn 為外部dcu文件,需要導入




    posted on 2010-02-22 11:48 Ke 閱讀(384) 評論(0)  編輯  收藏 所屬分類: delphi
    主站蜘蛛池模板: 国产免费人成视频尤勿视频| 无码人妻久久一区二区三区免费丨| 久久91亚洲人成电影网站| 久热免费在线视频| 亚洲一级高清在线中文字幕| 一本久久综合亚洲鲁鲁五月天| 国产午夜成人免费看片无遮挡| 亚洲av专区无码观看精品天堂| 国产午夜影视大全免费观看| 久久这里只精品热免费99| 亚洲中文字幕久久无码| 亚洲人成在线播放网站| 成人毛片免费观看视频大全| 久久久免费观成人影院| 亚洲人精品亚洲人成在线| 中文亚洲AV片在线观看不卡| 野花高清在线观看免费3中文| 一区二区三区在线免费| 亚洲国产精品久久人人爱| 亚洲毛片网址在线观看中文字幕| 热re99久久6国产精品免费| 美女免费视频一区二区| 中文字幕亚洲精品资源网| 亚洲国产精品毛片av不卡在线 | 日韩精品亚洲专区在线影视| 久久精品夜色国产亚洲av| 国产又黄又爽又刺激的免费网址| 四虎影视在线影院在线观看免费视频| 精品国产亚洲一区二区三区在线观看| 香蕉蕉亚亚洲aav综合| 亚洲国产精品成人| 免费黄色大片网站| 又大又硬又爽又粗又快的视频免费| 一级特黄aaa大片免费看| 亚洲小说图区综合在线| 久久精品国产亚洲精品2020| 久久久久亚洲AV无码专区网站| 在线A级毛片无码免费真人| 四虎在线免费视频| 久久久久久一品道精品免费看 | 久久最新免费视频|