网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > Delphi
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.事件的危机——调试手记之一.
.如何移动没有标题的窗体.
.delphi中宏小用.
.使DevExpress日期控件正确显示.
.用Delphi制作以浏览器为界面的应.
.组件制作之五(托盘组件).
.改良版TStringList类.
.DLL全局钩子.
.Borland有一个梦,程序员的梦.
.用DELPHI通过写注册表来实现建立.
.从获取DBGrid行号想到的.
.一个简单的菜单按钮的实现.
.delphi的属性property和消息处理.
.VCL消息处理机制的内幕.
.开发设计图文并茂的报表的组件.
.如何访问一个进程的内存空间.
.创建不规则形状的Control.
.在Delphi中进行指纹仪的二次开发.
.Delphi图象截取编程示例(2).
.delphi7从入门到精通之四.

全透明窗体(效果比较好)

发表日期:2006-2-4


全透明窗体(效果比较好)
uses里加上ExtCtrls
procedure tform1.setformtransparent;
var
  I: Integer;
  FullRgn,
  ClientRgn,
  ControlRgn: THandle;
  Margin,
  MarginX,
  MarginY,
  X,
  Y: Integer;
  W,H,S :Integer;
  bX,bY :Integer;
  c     :TColor;
begin
  Margin := (Width - ClientWidth) div 2;
  FullRgn := CreateRectRgn(0, 0, Width, Height);
  MarginX := Margin;
  MarginY := Height - ClientHeight - Margin;
  ClientRgn := CreateRectRgn(MarginX, MarginY, MarginX + ClientWidth, MarginY + ClientHeight);
  CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
  DeleteObject(ClientRgn);
  for I:=0 to ControlCount-1 do
  begin
    X := MarginX + Controls[I].Left;
    Y := MarginY + Controls[I].Top;
    W:=Controls[I].Width;
    H:=Controls[I].Height;
{}
    if controls[i] is timage then begin
      with controls[i] as tImage do begin
        c:=Picture.Bitmap.Canvas.Pixels[0,0];
        for bX:=0 to Picture.Bitmap.Width-1 do begin
          for bY:=0 to Picture.Bitmap.Height-1 do begin
            if Picture.Bitmap.Canvas.Pixels[bX,bY]<>c then begin
              ControlRgn := CreateRectRgn(X+bX, Y+bY, X + bX+1, Y + bY+1);
              CombineRgn(FullRgn, FullRgn, ControlRgn, RGN_OR);
              DeleteObject(ControlRgn);
            end;
          end;
        end;
      end;
    end else
{}
    if controls[i] is tShape then begin
      if W < H then S := W else S := H;
      if (Controls[i] as tshape).Shape in [stSquare, stRoundSquare, stCircle] then
      begin
        Inc(X, (W - S) div 2);
        Inc(Y, (H - S) div 2);
        W := S;
        H := S;
      end;
      Inc(W); Inc(H); Inc(S);
      case (controls[i] as tshape).Shape of
        stRectangle, stSquare:
          ControlRgn := CreateRectRgn(X, Y, X + W, Y + H);
        stRoundRect, stRoundSquare:
          ControlRgn := CreateRoundRectRgn(X, Y, X + W, Y + H, S div 4, S div 4);
        stCircle, stEllipse:
          ControlRgn:=CreateEllipticRgn(X, Y, X + W, Y + H);
      else
        ControlRgn := CreateRectRgn(X, Y, X + W, Y + H);
      end;
      CombineRgn(FullRgn, FullRgn, ControlRgn, RGN_OR);
      DeleteObject(ControlRgn);
    end else
{}
    begin
      ControlRgn := CreateRectRgn(X, Y, X + W, Y + H);
      CombineRgn(FullRgn, FullRgn, ControlRgn, RGN_OR);
      DeleteObject(ControlRgn);
    end;
  end;
  SetWindowRgn(Handle, FullRgn, True);
  DeleteObject(FullRgn);
end;

procedure TForm1.FormResize(Sender: TObject);
begin
        setformtransparent;
end;

//rock
//转载请保留此信息

上一篇:如何控制其他程序窗体上的窗口控件:中 人气:5521
下一篇:一个从EXE、DLL文件中提取、存取图标完整程序 人气:4931
浏览全部Delphi的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐