| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4251 人关注过本帖
标题:【求助】picturebox放大效果的实现?
只看楼主 加入收藏
wwx024
Rank: 1
等 级:新手上路
帖 子:33
专家分:4
注 册:2008-6-15
收藏
 问题点数:0 回复次数:5 
【求助】picturebox放大效果的实现?
我在窗体上端有一系列图片的缩略图,当鼠标放在某个缩略图片上时,这个图片从窗体上端逐渐放大并显示在窗体中央。
搜索更多相关主题的帖子: picturebox 效果 
2008-09-26 22:37
wwx024
Rank: 1
等 级:新手上路
帖 子:33
专家分:4
注 册:2008-6-15
收藏
得分:0 
2008-09-27 09:44
hellson
Rank: 2
来 自:北京
等 级:新手上路
威 望:4
帖 子:195
专家分:0
注 册:2008-9-1
收藏
得分:0 
我当时是这么做的
        void PictureBox1MouseEnter(object sender, System.EventArgs e)
        {
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox1.Height = 600;
            this.pictureBox1.Width = 800;
        }
        
        void PictureBox1MouseLeave(object sender, System.EventArgs e)
        {
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.None;
            this.pictureBox1.Height = 150;
            this.pictureBox1.Width = 200;
        }

春了夏了秋冬了,来了来了又来了
相信我的帖子打开都很快,看我头像就知道了
2008-09-27 11:31
606liutong
Rank: 2
等 级:论坛游民
威 望:2
帖 子:740
专家分:94
注 册:2006-10-9
收藏
得分:0 
LS 的是一步到位 要是逐渐变大的话更麻烦。。。。

前程——漆黑如这落寞的夜,苦苦守望,却总也望不到那泛着点点苍白的黎明!期望与希冀!无奈与魂殇!
獨自壹個人,望著大海淚流.
愛情,不敢奢望...
2008-09-27 14:14
shmilylee
Rank: 2
来 自:江苏扬州蹩脚小公司
等 级:论坛游民
威 望:2
帖 子:242
专家分:22
注 册:2007-7-6
收藏
得分:0 
加上定时器就可以了,以前做过窗体从透明慢慢显现的!
2008-09-27 14:17
hellson
Rank: 2
来 自:北京
等 级:新手上路
威 望:4
帖 子:195
专家分:0
注 册:2008-9-1
收藏
得分:0 
逐渐变大也有,只是原帖找不到不好转 ,就是这个 鼠标滚动实现图片的放大和缩小(C#2.0)

程序代码:
private void pictureEdit1_Properties_MouseWheel(object sender, MouseEventArgs e)
        {
            
            Rectangle oldrct;
            Bitmap bmp;
            bmp = (Bitmap)this.pictureEdit1.Image;
            oldrct = new Rectangle(0, 0, bmp.Width, bmp.Height);
            this.pictureEdit1.Image = bmp;
            Bitmap tmpbmp = null;
            int i = e.Delta;
            if (i > 0)
            {
                tmpbmp = new Bitmap(bmp.Width * 2, bmp.Height * 2);
            }
            else
            {
                tmpbmp = new Bitmap(bmp.Width / 2, bmp.Height / 2);
            }
            Graphics g = Graphics.FromImage(tmpbmp);
            Rectangle newrct = new Rectangle(0, 0, tmpbmp.Width, tmpbmp.Height);

            g.DrawImage(bmp, newrct, oldrct, GraphicsUnit.Pixel);//newrct是你的目标矩形位置,oldrct是你原始图片的起始矩形位置 
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            //oldrct = oldrct;
            pictureEdit1.Image = tmpbmp;
            g.Dispose();
            pictureEdit1.Update();
        } 



配合楼上的dd就好了

春了夏了秋冬了,来了来了又来了
相信我的帖子打开都很快,看我头像就知道了
2008-09-27 14:21
快速回复:【求助】picturebox放大效果的实现?
数据加载中...
 
   



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

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