如何用image和Bitmap,在窗体显示时实现百叶窗效果(我只能在button1事件中实现)

pmwb 2003-11-21 12:49:33
窗体上放有一个image并设置显示为false,想在窗体显示时实现百叶窗效果
procedure TForm1.Button1Click(Sender: TObject);
var
newbmp: TBitmap;
i,j,bmpheight,bmpwidth:integer;
xgroup,xcount:integer;
begin
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
//百叶窗效果
xgroup:=16;
xcount:=bmpheight div xgroup;
for i:=0 to xcount do
for j:=0 to xgroup do
begin
newbmp.Canvas.CopyRect(Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i),
image1.Canvas,Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i));
form1.Canvas.Draw(0,0,newbmp);
end;
newbmp.free;
end;
...全文
114 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
delphizd 2003-11-25
  • 打赏
  • 举报
回复
http://218.56.11.178:8020/web/index.aspx

->软件基地 ->搜索-》34种图像特效(源码)
xiangwangz 2003-11-24
  • 打赏
  • 举报
回复
帮你顶!俺不懂
jpyc 2003-11-23
  • 打赏
  • 举报
回复
这样可以不停的变换,如果仅需要一次,就在OnShow中
jpyc 2003-11-23
  • 打赏
  • 举报
回复
如果做自动的,可以考虑在TIMER里实现
aiirii 2003-11-21
  • 打赏
  • 举报
回复
那试试在窗体的 OnShow中!
web700 2003-11-21
  • 打赏
  • 举报
回复
用一个这样的控件吧

编码太麻烦了
我以前见过这种东西 的

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧