看这个方法,这个方法还是只能画4边形,我给它加一个点就报错了
http://msdn.microsoft.com/zh-cn/library/4f9s3at1(v=vs.110).aspx
5 个解决方案
#1
sorry,drawimage used in quadrilateral;
#2
我们用路径和区域描述不规则的曲线和区域
看这里:http://msdn.microsoft.com/zh-cn/subscriptions/downloads/530a2kct(v=vs.90).aspx
先扫盲下
看这里:http://msdn.microsoft.com/zh-cn/subscriptions/downloads/530a2kct(v=vs.90).aspx
先扫盲下
#3
DrawImage确实不行,还有办法吗,只要不是一个像素一个像素的拷贝就行,太慢了
#4
等于没说
#5
原链接:http://blog.csdn.net/chinacsharper/article/details/50854852
使用TextureBrush可以做到!!
private Image CutEllipse(Image img, Rectangle rec, Size size)
{
Bitmap bitmap = new Bitmap(size.Width, size.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
using (TextureBrush br = new TextureBrush(img,System.Drawing.Drawing2D.WrapMode.Clamp, rec))
{
br.ScaleTransform(bitmap.Width / (float)rec.Width, bitmap.Height / (float)rec.Height);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.FillEllipse(br, new Rectangle(Point.Empty, size));
}
}
return bitmap;
}
使用TextureBrush可以做到!!
private Image CutEllipse(Image img, Rectangle rec, Size size)
{
Bitmap bitmap = new Bitmap(size.Width, size.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
using (TextureBrush br = new TextureBrush(img,System.Drawing.Drawing2D.WrapMode.Clamp, rec))
{
br.ScaleTransform(bitmap.Width / (float)rec.Width, bitmap.Height / (float)rec.Height);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.FillEllipse(br, new Rectangle(Point.Empty, size));
}
}
return bitmap;
}
#1
sorry,drawimage used in quadrilateral;
#2
我们用路径和区域描述不规则的曲线和区域
看这里:http://msdn.microsoft.com/zh-cn/subscriptions/downloads/530a2kct(v=vs.90).aspx
先扫盲下
看这里:http://msdn.microsoft.com/zh-cn/subscriptions/downloads/530a2kct(v=vs.90).aspx
先扫盲下
#3
DrawImage确实不行,还有办法吗,只要不是一个像素一个像素的拷贝就行,太慢了
#4
等于没说
#5
原链接:http://blog.csdn.net/chinacsharper/article/details/50854852
使用TextureBrush可以做到!!
private Image CutEllipse(Image img, Rectangle rec, Size size)
{
Bitmap bitmap = new Bitmap(size.Width, size.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
using (TextureBrush br = new TextureBrush(img,System.Drawing.Drawing2D.WrapMode.Clamp, rec))
{
br.ScaleTransform(bitmap.Width / (float)rec.Width, bitmap.Height / (float)rec.Height);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.FillEllipse(br, new Rectangle(Point.Empty, size));
}
}
return bitmap;
}
使用TextureBrush可以做到!!
private Image CutEllipse(Image img, Rectangle rec, Size size)
{
Bitmap bitmap = new Bitmap(size.Width, size.Height);
using (Graphics g = Graphics.FromImage(bitmap))
{
using (TextureBrush br = new TextureBrush(img,System.Drawing.Drawing2D.WrapMode.Clamp, rec))
{
br.ScaleTransform(bitmap.Width / (float)rec.Width, bitmap.Height / (float)rec.Height);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.FillEllipse(br, new Rectangle(Point.Empty, size));
}
}
return bitmap;
}