Esempio n. 1
0
        public void Page_Draw_PieSlices()
        {
            var app  = this.GetVisioApplication();
            var doc  = this.GetNewDoc();
            var page = app.ActivePage;

            int    n           = 36;
            double start_angle = 0.0;
            double radius      = 1.0;
            double cx          = 0.0;
            double cy          = 2.0;
            double angle_step  = Math.PI * 2.0 / (n - 1);

            foreach (double end_angle in Enumerable.Range(0, n).Select(i => i * angle_step))
            {
                var center = new VA.Drawing.Point(cx, cy);
                var ps     = new VACHART.PieSlice(center, radius, start_angle, end_angle);
                ps.Render(page);
                cx += 2.5;
            }

            var bordersize = new VA.Drawing.Size(1, 1);

            page.ResizeToFitContents(bordersize);

            doc.Close(true);
        }
        public void Page_Draw_PieSlices()
        {
            var app = this.GetVisioApplication();
            var doc = this.GetNewDoc();
            var page = app.ActivePage;

            int n = 36;
            double start_angle = 0.0;
            double radius = 1.0;
            double cx = 0.0;
            double cy = 2.0;
            double angle_step = Math.PI * 2.0 / (n - 1);

            foreach (double end_angle in Enumerable.Range(0, n).Select(i => i * angle_step))
            {
                var center = new VA.Drawing.Point(cx, cy);
                var ps = new VACHART.PieSlice(center, radius, start_angle, end_angle);
                ps.Render(page);
                cx += 2.5;
            }

            var bordersize = new VA.Drawing.Size(1, 1);
            page.ResizeToFitContents(bordersize);

            doc.Close(true);
        }
Esempio n. 3
0
        public IVisio.Shape PieSlice(VA.Drawing.Point center,
                                     double radius,
                                     double start_angle,
                                     double end_angle)
        {
            this.AssertApplicationAvailable();
            this.AssertDocumentAvailable();

            var application = this.Client.VisioApplication;

            using (var undoscope = new VA.Application.UndoScope(this.Client.VisioApplication, "Draw Pie Slice"))
            {
                var active_page = application.ActivePage;
                var slice       = new VA.Models.Charting.PieSlice(center, radius, start_angle, end_angle);
                var shape       = slice.Render(active_page);
                return(shape);
            }
        }
        public IVisio.Shape PieSlice(VA.Drawing.Point center,
            double radius,
            double start_angle,
            double end_angle)
        {
            this.AssertApplicationAvailable();
            this.AssertDocumentAvailable();

            var application = this.Client.VisioApplication;
            using (var undoscope = new VA.Application.UndoScope(this.Client.VisioApplication, "Draw Pie Slice"))
            {
                var active_page = application.ActivePage;
                var slice = new VA.Models.Charting.PieSlice(center, radius, start_angle, end_angle);
                var shape = slice.Render(active_page);
                return shape;
            }
        }