解决方案 »
- asp.net中Windows身份验证怎么设置能让它不出现用户名登录的那个框框。
- 一个关于拼图算法的问题(倾家荡产高分结贴)
- 关于数据库的绑定显示问题
- 帮忙看看是什么问题。
- MSDN Library for VS2005 SP1中文版已经出来了
- Icmp中CheckSum的计算原理和实现方法?
- 请教C#调用C++ DLL的问题
- 关于asp调用系统cmd命令
- 怎样将C#写的windowsform做成控件发布到web上
- 【求助】ajaxpro与ashx冲突
- Winfrom下的Chart控件如何加载?VS2010 .NetFramework 4.0
- itextsharp 向已有的pdf文件里 新添加一页
具体如何操作,我对GDI不熟悉。还请指点。
/// <summary>
/// 截取背景图两边,中间填充
/// </summary>
public void SetBackGroundImage()
{
this.BackgroundImage = null;
Bitmap bit = new Bitmap(this.Width,this.Height);
Graphics g = Graphics.FromImage(bit);
g.DrawImage(Properties.Resources.pallet, new Rectangle(new Point(0, 0), new Size(107, Properties.Resources.pallet.Height)), new Rectangle(new Point(0, 0), new Size(107, Properties.Resources.pallet.Height)), GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.pallet, new Rectangle(new Point(107, 0), new Size(Properties.Resources.pallet.Width - 107 - 107, Properties.Resources.pallet.Height)), new Rectangle(new Point(107, 0), new Size(107, Properties.Resources.pallet.Height)), GraphicsUnit.Pixel);
g.DrawImage(Properties.Resources.pallet, new Rectangle(new Point(this.Width - 107, 0), new Size(107, Properties.Resources.pallet.Height)), new Rectangle(new Point(Properties.Resources.pallet.Width - 107, 0), new Size(Properties.Resources.pallet.Width - 107, Properties.Resources.pallet.Height)), GraphicsUnit.Pixel); this.BackgroundImage = bit;
}解决了,不过还是有点小问题。
直接用这里面的界面库,使用SkinButton自定义按钮控件里面的BackRectangle九宫区域属性即可解决