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

来源:互联网 发布:剑三异瞳喵太捏脸数据 编辑:程序博客网 时间:2024/04/28 10:35

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);}


原创粉丝点击