Silverlight 引路蜂二维图形库示例:椭圆

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/mapdigit/article/details/7669945

FillOval 和DrawOval 用来填充和绘制椭圆。下面例子显示椭圆的用法。

private void Ovals()
{
 Color redColor = new Color(0x96ff0000, true);
 Color greenColor = new Color(0x00ff00);
 AffineTransform mat1;
 mat1 = new AffineTransform();
 mat1.Translate(30, 40);
 mat1.Rotate(-30 * Math.PI / 180.0);
 graphics2D.Reset();
 graphics2D.Clear(Color.White);
 
 graphics2D.AffineTransform = new AffineTransform();
 SolidBrush brush = new SolidBrush(greenColor);
 graphics2D.FillOval(brush, 20, 60, 100, 50);
 
 Pen pen = new Pen(redColor, 5);
 graphics2D.AffineTransform = mat1;
 graphics2D.DrawOval(pen, 20, 60, 100, 50);
}


展开阅读全文

没有更多推荐了,返回首页