Render() public method

we do NOT store vxs
public Render ( VertexStore vxs, Drawing c ) : void
vxs VertexStore
c Drawing
return void
Beispiel #1
0
        public override void OnDraw(Graphics2D graphics2D)
        {
            if (myvxs == null)
            {
                var transform = Affine.NewMatix(
                        AffinePlan.Translate(-lionShape.Center.x, -lionShape.Center.y),
                        AffinePlan.Scale(spriteScale, spriteScale),
                        AffinePlan.Rotate(angle + Math.PI),
                        AffinePlan.Skew(skewX / 1000.0, skewY / 1000.0),
                        AffinePlan.Translate(Width / 2, Height / 2)
                );
                //create vertextStore again from origiinal path 
                myvxs = transform.TransformToVxs(lionShape.Path.Vxs, new VertexStore());
            }
            //---------------------------------------------------------------------------------------------
            {
                int j = lionShape.NumPaths;
                int[] pathList = lionShape.PathIndexList;
                PixelFarm.Drawing.Color[] colors = lionShape.Colors;
                //graphics2D.UseSubPixelRendering = true;

                for (int i = 0; i < j; ++i)
                {
                    graphics2D.Render(new VertexStoreSnap(myvxs, pathList[i]), colors[i]);
                }
            }
            //---------------------------------------------------------------------------------------------


        }
Beispiel #2
0
        public static void DrawString(this Graphics2D gx,
                                      string text,
                                      double x,
                                      double y,
                                      double pointSize            = 12,
                                      Justification justification = Justification.Left,
                                      Baseline baseline           = Baseline.Text,
                                      ColorRGBA color             = new ColorRGBA(),
                                      bool drawFromHintedCache    = false,
                                      ColorRGBA backgroundColor   = new ColorRGBA())
        {
            ////use svg font
            var svgFont       = SvgFontStore.LoadFont(SvgFontStore.DEFAULT_SVG_FONTNAME, (int)pointSize);
            var stringPrinter = new MyTypeFacePrinter();

            stringPrinter.CurrentFont         = svgFont;
            stringPrinter.DrawFromHintedCache = false;
            stringPrinter.LoadText(text);
            var vxs = stringPrinter.MakeVxs();

            vxs = Affine.NewTranslation(x, y).TransformToVxs(vxs);
            gx.Render(vxs, ColorRGBA.Black);
        }
Beispiel #3
0
 /// <summary>
 /// draw circle
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="radius"></param>
 /// <param name="color"></param>
 public void FillCircle(double x, double y, double radius, ColorRGBA color)
 {
     ellipse.Reset(x, y, radius, radius);
     gx.Render(ellipse.MakeVxs(), color);
 }
        public static void Rectangle(this Graphics2D gx, double left, double bottom, double right, double top, ColorRGBA color, double strokeWidth = 1)
        {
            RoundedRect rect = new RoundedRect(left + .5, bottom + .5, right - .5, top - .5, 0);

            gx.Render(new Stroke(strokeWidth).MakeVxs(rect.MakeVxs()), color);
        }
        public static void Circle(this Graphics2D g, double x, double y, double radius, ColorRGBA color)
        {
            Ellipse elipse = new Ellipse(x, y, radius, radius);

            g.Render(elipse.MakeVxs(), color);
        }