首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

关于窗体中图片拉伸的有关问题

2012-02-24 
关于窗体中图片拉伸的问题我现在要做一个类似与《金山词霸2006》风格的窗体,请问怎样才能使图片的一部分保持

关于窗体中图片拉伸的问题
我现在要做一个类似与《金山词霸2006》风格的窗体,请问怎样才能使图片的一部分保持不变其他的部分随着窗体的伸缩而不会产生变形?就像《金山词霸2006》中工具栏的右边按钮部分不会缩放,谢谢

[解决办法]
是一个图的话肯定就不行
楼主考虑用一下PANEL控件
能达到你的要求
[解决办法]
两张图吧
[解决办法]
两张图合一块,一部分可拉伸,一部分固定
[解决办法]
可以绘制两次.
private void drawImage2(Image img, int x, int y,int upHeight, int downHeight){
Rectangle ImgUpRect = new Rectangle (0,0, img.Width,upHeight);
Rectangle ImgDownRect = new Rectangle (0,upHeight, img.Width,img.Height - upHeight);

Rectangle drawUpRect = new Rectangle (x,y, img.Width,upHeight);
Rectangle drawDownRect = new Rectangle (x,y+upHeight, img.Width,downHeight);

g.DrawImage(Img, drawUpRect, ImgUpRect, GraphicsUnit.Pixel);
g.DrawImage(Img, ImgDownRect , drawDownRect , GraphicsUnit.Pixel);
}

热点排行