CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
花落谁家,你作主! 盛大widget设计大赛英雄榜
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  基础类

怎样实现以特效显示图像?

楼主kenwoodking(爱的牧羊人)2002-04-12 12:49:05 在 C++ Builder / 基础类 提问

百叶窗的特效………………  
  =======================  
  代码……让你疯狂  
  ======================= 问题点数:100、回复次数:2Top

1 楼yyyyin(yyyy)回复于 2002-04-12 13:21:45 得分 40

define   a   private   variable   'Graphics::TBitmap   *bmp'  
   
  __fastcall   TForm1::TForm1(TComponent*   Owner)  
      :   TForm(Owner)  
  {  
      bmp   =   0;  
  }  
   
  void   __fastcall   TForm1::Button1Click(TObject   *Sender)  
  {  
      if(OpenPictureDialog1->Execute()){  
          if(bmp)  
              delete   bmp;  
          bmp   =   new   Graphics::TBitmap;  
          bmp->LoadFromFile(OpenPictureDialog1->FileName);  
          Paint();  
      }  
  }  
   
  void   __fastcall   TForm1::FormPaint(TObject   *Sender)  
  {  
      if(bmp){  
          int   group   =   10;  
          int   count   =   bmp->Height   /   group;  
          for(int   i=0;   i<count;   i++)  
              for(int   j=0;   j<group;   j++){  
                  bmp->Canvas->CopyRect(TRect(0,   count*j+i-1,   bmp->Width,   count*j+i),  
                    Canvas,   TRect(0,   count*j+i-1,   bmp->Width,   count*j+i));  
                  ::Sleep(10);  
                  Canvas->Draw(10,10,bmp);  
              }  
      }  
  }Top

2 楼Cbfan(民族英雄~~)回复于 2002-04-12 16:51:24 得分 60

从一个图形   百叶窗转变成另一个图形。  
   
  下面是代码,别忘了给分~~  
   
  void   __fastcall   TForm1::Button1Click(TObject   *Sender)  
  {  
          Graphics::TBitmap   *image1=new   Graphics::TBitmap();  
          Graphics::TBitmap   *image2=new   Graphics::TBitmap();  
          image2->LoadFromFile("1.bmp");  
          image1->LoadFromFile("2.bmp");  
                  int   i,j,bmpheight,bmpwidth,xgroup,xcount;  
                  image1->Width=image2->Width;  
                  image1->Height=image2->Height;  
                  bmpheight=image2->Height;  
                  bmpwidth=image2->Width;  
                  xgroup=16;  
                  xcount=div(bmpheight,xgroup).quot;  
                  for(i=0;i<=xcount;i++)  
                          {  
                                  for(j=0;j<xgroup;j++)  
                                          {  
                                                  image1->Canvas->CopyRect(Rect(0,xcount*j+i-1,  
                                                  bmpwidth,xcount*j+i),  
                                                  image2->Canvas,Rect(0,xcount*j+i-1,  
                                                  bmpwidth,xcount*j+i));  
                                                  Form1->Canvas->Draw(10,10,image1);  
                                          }  
                          }  
   
                delete   image1,image2;  
  }  
  //---------------------------------------------------------------------------Top

相关问题

  • 怎样实现以特效显示图像?②
  • 怎样实现以特效显示图像?③
  • 怎样实现以特效显示图像? ④
  • 怎样实现以特效显示图像? ⑤
  • 怎样实现以特效显示图像? ⑥⑥
  • 怎样实现以特效显示图像? ⑦
  • 在C++BUILDER下如何实现图像特效?
  • 如何实现图像列表显示
  • 实现一个图像显示控件
  • 这种图片显示特效如何实现?

关键词

  • j+i
  • xcount
  • bmp
  • tbitmap
  • xgroup
  • bmpwidth
  • bmpheight
  • fastcall tform
  • canvas
  • image

得分解答快速导航

  • 帖主:kenwoodking
  • yyyyin
  • Cbfan

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo