本文整理汇总了C#中Microsoft.Office.Interop.Visio.DrawOval方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Visio.DrawOval方法的具体用法?C# Microsoft.Office.Interop.Visio.DrawOval怎么用?C# Microsoft.Office.Interop.Visio.DrawOval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Visio
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Visio.DrawOval方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderPie
public IVisio.Shape RenderPie( IVisio.Page page)
{
if (this.Angle == 0.0)
{
var p1 = this.GetPointAtRadius(this.Center, this.Radius, this.SectorStartAngle);
return page.DrawLine(this.Center, p1);
}
else if (this.Angle >= 2*System.Math.PI)
{
var A = this.Center.Add(-this.Radius, -this.Radius);
var B = this.Center.Add(this.Radius, this.Radius);
var rect = new VA.Drawing.Rectangle(A, B);
var shape = page.DrawOval(rect);
return shape;
}
else
{
int degree;
var pie_bez = this.GetShapeBezierForPie(out degree);
// Render the bezier
var doubles_array = VA.Drawing.Point.ToDoubles(pie_bez).ToArray();
var pie_slice = page.DrawBezier(doubles_array, (short)degree, 0);
return pie_slice;
}
}
示例2: DrawCircleFromCenter
public static IVisio.Shape DrawCircleFromCenter(IVisio.Page page, double x, double y, double r)
{
var shape = page.DrawOval(x - r, y - r, x + r, y + r);
return shape;
}
示例3: RenderDoughnut
public IVisio.Shape RenderDoughnut(IVisio.Page page)
{
double total_angle = this.Angle;
if (total_angle == 0.0)
{
var p1 = this.GetPointAtRadius(this.Center, this.SectorStartAngle, this.InnerRadius);
var p2 = this.GetPointAtRadius(this.Center, this.SectorStartAngle, this.Radius);
var shape = page.DrawLine(p1, p2);
return shape;
}
else if (total_angle >= System.Math.PI)
{
var outer_radius_point = new VA.Drawing.Point(this.Radius, this.Radius);
var C = this.Center - outer_radius_point;
var D = this.Center + outer_radius_point;
var outer_rect = new VA.Drawing.Rectangle(C, D);
var inner_radius_point = new VA.Drawing.Point(this.InnerRadius, this.InnerRadius);
var A = this.Center - inner_radius_point - C;
var B = this.Center + inner_radius_point - C;
var inner_rect = new VA.Drawing.Rectangle(A, B);
var shape = page.DrawOval(outer_rect);
shape.DrawOval(inner_rect.Left, inner_rect.Bottom, inner_rect.Right, inner_rect.Top);
return shape;
}
else
{
int degree;
var thickarc = this.GetShapeBezierForDoughnut(out degree);
// Render the bezier
var doubles_array = VA.Drawing.Point.ToDoubles(thickarc).ToArray();
var pie_slice = page.DrawBezier(doubles_array, (short)degree, 0);
return pie_slice;
}
}
示例4: Render
public void Render(IVisio.Page page)
{
double sum = this._slices.Select(s => s.Value).Sum();
var shapes = new List<IVisio.Shape>();
double start_angle = 0.0;
// Draw each slice
for (int i = 0; i < this.Slices.Count; i++)
{
var slice = this.Slices[i];
double cur_val = slice.Value;
double cur_val_norm = cur_val / sum;
double cur_angle = cur_val_norm * System.Math.PI * 2.0;
double end_angle = start_angle + cur_angle;
slice.StartAngle = start_angle;
slice.EndAngle = end_angle;
var ps = new VA.Layout.Models.Radial.PieSlice(this.Center, start_angle, end_angle, this.Radius);
var shape = ps.Render(page);
start_angle += cur_angle;
shapes.Add(shape);
}
for (int i = 0; i < shapes.Count; i++)
{
var shape = shapes[i];
var slice = this._slices[i];
slice.VisioShape = shape;
if (!string.IsNullOrEmpty(slice.Text))
{
shape.Text = slice.Text;
}
}
if (this.DrawBackground)
{
var ll = this.Center.Subtract(this.Radius, this.Radius);
var ur = this.Center.Add(this.Radius, this.Radius);
var rect = new VA.Drawing.Rectangle(ll, ur);
this._backgroundVisioShape = page.DrawOval(rect);
}
}