| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 642 人关注过本帖
标题:编写一个程序,要求如下:
只看楼主 加入收藏
我TDST
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-7-3
结帖率:0
收藏
 问题点数:0 回复次数:5 
编写一个程序,要求如下:
编写一个程序,要求如下:
1. 能进行简单的图形绘制
2. 实现从下到上的字幕效果
3.采用CopyRect实现任意一种图形特效(从左到右,从右到左,从上到下,从下到上,从中间到两边,百叶窗,拉伸等等)

求高手指点 啊   谢谢啊、、
2011-07-03 22:59
huanqiu1699
Rank: 2
等 级:论坛游民
帖 子:5
专家分:19
注 册:2011-7-7
收藏
得分:0 
你想用什么代码写那
2011-07-07 13:29
yuutian
Rank: 7Rank: 7Rank: 7
等 级:黑侠
帖 子:137
专家分:686
注 册:2010-10-27
收藏
得分:0 
图形特效
unit ChangeImage;

 

interface

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs,jpeg, StdCtrls, ExtCtrls;

 

procedure BaiYeChuang(Targer:Timage;Source:Tbitmap);//百叶窗

procedure MaSaiKe(Targer:Timage;Source:Tbitmap);//马赛克

procedure JiaoCuo(Targer:Timage;Source:Tbitmap);//交错

procedure FromCenter(Targer:Timage;Source:Tbitmap);//从中心渐入

procedure ZhanKaiFromLeft(Targer:Timage;Source:Tbitmap);//从左边展开

procedure FlyInFromLeft(Targer:Timage;Source:Tbitmap);//从左边飞入

procedure Rain(Targer:Timage;Source:Tbitmap);//雨滴

 

implementation

 

uses Math;

 

procedure Rain(Targer:Timage;Source:Tbitmap);

var

  i:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  for i:=0 to bmpheigth do

  begin

    from:=Rect(0,bmpheigth-i-1,bmpwidth,bmpheigth-i);

    too:=Rect(0,0,bmpwidth,bmpheigth-i);

    Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,from);

    Application.ProcessMessages;

  end;

  Targer.Refresh;

end;

 

procedure ZhanKaiFromLeft(Targer:Timage;Source:Tbitmap);

var

  i:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  for i:=0 to bmpwidth do

  begin

    from:=Rect(bmpwidth-i,0,bmpwidth,bmpheigth);

    Targer.Picture.Bitmap.Canvas.CopyRect(from,Source.Canvas,from);

    Application.ProcessMessages;

  end;

  Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,too);

  Targer.Refresh;

end;

 

procedure FlyInFromLeft(Targer:Timage;Source:Tbitmap);

var

  i:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

const

  squ=40;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  for i:=0 to bmpwidth do

  begin

    from:=Rect(bmpwidth-i,0,bmpwidth,bmpheigth);

    too:=Rect(0,0,i,bmpheigth);

    Targer.Picture.Bitmap.Canvas.CopyRect(from,Source.Canvas,too);

    Application.ProcessMessages;

  end;

  Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,too);

  Targer.Refresh;

end;

 

 

procedure FromCenter(Targer:Timage;Source:Tbitmap);

var

  i,x:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

  opointx,opointy,cj:Integer;

  check:Boolean;

const

  squ=40;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  opointx:=bmpwidth div 2;

  opointy:=bmpheigth div 2;

 

  check:=bmpwidth>bmpheigth;

 

  cj:=IfThen(check,(bmpwidth-bmpheigth) div 2,(bmpheigth-bmpwidth) div 2);

  x:=IfThen(check,opointy,opointx);

 

  for i:=0 to x do

  begin

    if check then

    begin

      from:=Rect(opointx-cj-i,opointy-i,opointx+cj+i,opointy+i);

      too:=Rect(opointx-cj-i,opointy-i,opointx+cj+i,opointy+i);

    end

    else

    begin

      from:=Rect(opointx-i,opointy-cj-i,opointx+i,opointy+cj+i);

      too:=Rect(opointx-i,opointy-cj-i,opointx+i,opointy+cj+i);

    end;

    Targer.Picture.Bitmap.Canvas.CopyRect(from,Source.Canvas,too);

    Targer.Refresh;

    Application.ProcessMessages;

  end;

end;

 

procedure JiaoCuo(Targer:Timage;Source:Tbitmap);

var

  i,j,xcount:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

const

  squwidth=20;

  squheight=20;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  xcount:=(bmpwidth div squwidth)+IfThen((bmpwidth mod squwidth)<>0,1,0);

 

  for i:=0 to bmpheigth do

  begin

    for j:=1 to xcount do

    begin

      if (j mod 2)=0 then

      begin

        from:=Rect((j-1)*squwidth,0,j*squwidth,i);

        too:=Rect((j-1)*squwidth,bmpheigth-i,j*squwidth,bmpheigth);

      end

      else

      begin

        too:=Rect((j-1)*squwidth,0,j*squwidth,i);

        from:=Rect((j-1)*squwidth,bmpheigth-i,j*squwidth,bmpheigth);

      end;

      Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,from);

    end;

    Targer.Refresh;

    Application.ProcessMessages;

  end;

 

end;

 

procedure BaiYeChuang(Targer:TImage;Source:TBitmap);

var

  i,j:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

  xgroup,xcount:Integer;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  xcount:=100;

  xgroup:=bmpheigth div xcount;

 

  for i:=0 to xgroup do

  begin

    for j:=0 to xcount do

    begin

      from:=Rect(0,j*xgroup+i-1,bmpwidth,j*xgroup+i);

      too:=Rect(0,j*xgroup+i-1,bmpwidth,j*xgroup+i);

      Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,from);

    end;

    Targer.Refresh;

    sleep(100);

    Application.ProcessMessages;

  end;

 

end;

 

procedure MaSaiKe(Targer:Timage;Source:Tbitmap);

var

  i,x,y:Integer;

  from,too:TRect;

  bmpwidth,bmpheigth:Integer;

const

  squ=40;

begin

  bmpwidth:=Targer.Width;

  bmpheigth:=Targer.Height;

 

  Source.Width:=bmpwidth;

  source.Height:=bmpheigth;

 

  Randomize;

  for i:=0 to 500 do

  begin

    x:=Random(bmpwidth div squ);

    y:=Random(bmpheigth div squ);

    from:=Rect(x*squ,y*squ,(x+1)*squ,(y+1)*squ);

    Targer.Picture.Bitmap.Canvas.CopyRect(from,Source.Canvas,from);

    Application.ProcessMessages;

  end;

  too:=Rect(0,0,bmpwidth,bmpheigth);

  Targer.Picture.Bitmap.Canvas.CopyRect(too,Source.Canvas,too);

  Targer.Refresh;

end;

end.

2011-07-08 08:46
我TDST
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-7-3
收藏
得分:0 
回复 2楼 huanqiu1699
delphi7..
2011-07-22 13:20
我TDST
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-7-3
收藏
得分:0 
回复 3楼 yuutian
谢谢呀
2011-07-22 13:21
我TDST
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2011-7-3
收藏
得分:0 
回复 5楼 我TDST
能加你QQ吗?
2011-07-22 13:21
快速回复:编写一个程序,要求如下:
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013291 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved