当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: 3)抓取窗体或控件图片 抓取窗体或控件图片,即要用到一个新的Form2,参见《Delphi图象截取编程示例(7)》 在Main单元implementation的uses中添加Capture2。
 

 

 ·delphi图象截取编程示例(7)    »显示摘要«
    摘要:(七)抓取窗体或控件图片窗体创建一个新的form2,保存为capture2.pas。设置属性bordericons的四个属性为false.borderstyle设为bsnone,formstyle设为fsstayontop.两个公共变量:frect:trect,fbmp:tbitmap; unit capture2; interface uses windows, messages, sys......
    摘要:相信大家会经常遇到需要在web页面上给用户生成excel报表的情况。我刚好在最近的工作中遇到了,下面是一个使用jxl包(一个开源的包)的实例。 //servlet中生成提供下载的excel文档的例程,这里用的是jxl包,当然也可以用apache的poi包试试。 public void dopost(httpservletrequest request,httpservletresponse res......


Delphi图象截取编程示例(5)

3)抓取窗体或控件图片

   抓取窗体或控件图片,即要用到一个新的form2,参见«delphi图象截取编程示例(7)» 【程序编程相关:linux生成RPM安装包的过程及问题解

【推荐阅读:VB.net入门(4):函数,过程

   在main单元implementation的uses中添加capture2. 【扩展信息:ASP 验证码的程序及原理

  

[capture windows or controls]窗体或控件抓图的action 事件

procedure tmainform.cptwindowsexecute(sender: tobject);

var p:tpoint; handles:hwnd;

begin

  inc(capturenum,1);

  application.minimize ;

  delay(500);

  filename:=´capture´+inttostr(capturenum);

  filename:=defaultdirectory+filename;

  with tform2.create(application) do

  try

    if showmodal=mrok then

    begin

      createmdichild(filename,true);

      statusbar.simpletext := filename;

      delay(500);

      abitmap:=tbitmap.create ;

      getcursorpos(p);

      handles:=windowfrompoint(p);

      abitmap:=capturewindowimage(handles);

      child.image1.picture.bitmap:=abitmap;


...   下一页
    摘要:要学习winform编程,关于软件自动升级的部分,今天一早就在csdn上找资料,终于有点概念了。 发现了一个不错的ftp站点,收藏了ftp://202.107.251.26 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE