<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)

    相冊(cè)

    收藏夾(18)

    JAVA

    搜索

    •  

    積分與排名

    • 積分 - 826119
    • 排名 - 49

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    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屬性必須設(shè)置為false

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




    posted on 2010-02-22 11:48 Ke 閱讀(387) 評(píng)論(0)  編輯  收藏 所屬分類: delphi
    主站蜘蛛池模板: 亚洲午夜无码久久| 男人和女人高潮免费网站| 免费鲁丝片一级在线观看| 免费国产va在线观看| 亚洲AV日韩精品久久久久| 国产男女爽爽爽爽爽免费视频| 亚洲jizzjizz少妇| 亚洲人成网站在线播放vr| 免费人成视频在线| 在线观看免费黄网站| 亚洲中文字幕AV每天更新| 亚洲精品无码成人AAA片| 女人18一级毛片免费观看| 久久福利青草精品资源站免费| 亚洲一本一道一区二区三区| 国产亚洲老熟女视频| 成人午夜视频免费| 免费高清国产视频| 免费人人潮人人爽一区二区| 亚洲欧洲日产国码www| 亚洲中文字幕无码不卡电影| 天天天欲色欲色WWW免费| 久久国产精品成人片免费| 羞羞网站在线免费观看| 亚洲中文无码线在线观看| 国产午夜亚洲精品午夜鲁丝片| 免费99精品国产自在现线| 国产一二三四区乱码免费 | 亚洲色欲色欱wwW在线| 亚洲第一极品精品无码久久| 免费一级毛片免费播放| 成年女人喷潮毛片免费播放| 99久久免费精品视频| 国产视频精品免费视频| 无码一区二区三区亚洲人妻| 亚洲区视频在线观看| 亚洲国产高清在线| 亚洲国产另类久久久精品黑人 | 久久久久久99av无码免费网站| 国产精品免费一区二区三区四区| 一区二区三区免费电影|