关于窗体中图片拉伸的问题 我现在要做一个类似与《金山词霸2006》风格的窗体,请问怎样才能使图片的一部分保持不变其他的部分随着窗体的伸缩而不会产生变形?就像《金山词霸2006》中工具栏的右边按钮部分不会缩放,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是一个图的话肯定就不行楼主考虑用一下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);} 安装程序在C:\Program Files下创建目录时对路径的访问被拒绝 再问个简单的问题 想找家公司体验实际的软件开发的生活,大伙给点建议 用模板创建的网页,在浏览时的错误:XX类同时存在于两个dll中 安装布署:如何判断用户输入的序列号正确与否? 如何把大文件写入到数据库的二进制字段中? C# 水晶报表(CrystalReport)自定义纸张大小的问题 求VSS6.0C或D的下载地址,能下的马上给分!谢了 在内存中创建文件的问题? 为什么我在Visual studio中调试中出现? 窗体背景不透明,不知道问题出在哪里了! winform窗体间的控制问题
楼主考虑用一下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);
}