Exemple #1
0
            public void Render(
                PdfRenderer renderer,
                ReportDesign reportDesign,
                Region region,
                ElementDesign design,
                object data)
            {
                Region         r  = region.ToPointScale(reportDesign);
                PdfContentByte cb = renderer.Writer.DirectContent;
                Single         x  = r.Left + r.GetWidth() / 2;
                Single         y  = r.Top + r.GetHeight() / 2;
                Single         w  = 12;

                cb.SaveState();
                cb.Rectangle(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 2), w, -w);
                cb.Stroke();
                if ((bool)data)
                {
                    cb.SetColorFill(PdfRenderUtil.GetColor("steelblue"));
                    cb.MoveTo(renderer.Trans.X(x - w / 2), renderer.Trans.Y(y - w / 4));
                    cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y + w / 2));
                    cb.LineTo(renderer.Trans.X(x + w / 2), renderer.Trans.Y(y - w / 2));
                    cb.LineTo(renderer.Trans.X(x - w / 4), renderer.Trans.Y(y));
                    cb.Fill();
                }
                cb.RestoreState();
            }
Exemple #2
0
            public void Render(
                RenderingEnv env,
                ReportDesign reportDesign,
                Region region,
                ElementDesign design,
                object data)
            {
                Region r = region.ToPointScale(reportDesign);
                Single x = r.Left + r.GetWidth() / 2;
                Single y = r.Top + r.GetHeight() / 2;
                Single w = 12;

                env.Graphics.DrawRectangle(Pens.Black, x - w / 2, y - w / 2, w, w);
                if ((bool)data)
                {
                    Point[] p =
                    {
                        new Point((int)(x - w / 2), (int)(y - w / 4)),
                        new Point((int)(x - w / 4), (int)(y + w / 2)),
                        new Point((int)(x + w / 2), (int)(y - w / 2)),
                        new Point((int)(x - w / 4), (int)(y))
                    };
                    env.Graphics.FillPolygon(Brushes.SteelBlue, p);
                }
            }