C#创建可拉伸的不规则界面

来源:百度知道 编辑:UC知道 时间:2024/05/31 11:32:12
如何创建一个可拉伸的不规则界面,即以图片为背景,可拉伸并不改变图片边角只对中间部分拉伸~~高人指点!!

一般来说不规则,只需要用到关键色
相信这个很多地方都会说到

如果你要做resize
一般的话最简单的像MSN这样的
RoundRectangle的话,简单做直接放在图片在后面,然后图片缩放就可以了
但这样会有一个问题,圆角会被压扁
所以讲究的话你需要采用九宫格的方法,分别在四个角贴4个小图片,其实只是一张的四个部分即可

resize还是需要自己进行调整
只要确保位置即可

圆角的话,

this.Region = new Region(GraphicsHelper.getRoundedRect(this.ClientRectangle, 10));

MORE DETAIL
static public GraphicsPath getRoundedRect(RectangleF baseRect, float radius) {
// if corner radius is less than or equal to zero,
// return the original rectangle
if (radius <= 0.0F) {
GraphicsPath mPath = new GraphicsPath();
mPath.AddRectangle(baseRect);
mPath.CloseFigure();
return mPath;
}

// if the corner radius is greater than or equal to