public MyMiniAggCanvasRenderElement(RootGraphic rootgfx, int width, int height) : base(rootgfx, width, height) { this.actualImage = new ActualImage(width, height, PixelFarm.Agg.PixelFormat.ARGB32); this.gfx2d = Graphics2D.CreateFromImage(actualImage); needUpdate = true; }
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]); } } //--------------------------------------------------------------------------------------------- }
public MiniAggCanvasRenderElement(RootGraphic rootgfx, int width, int height) : base(rootgfx, width, height) { this.actualImage = new ActualImage(width, height, PixelFarm.Agg.PixelFormat.ARGB32); this.gfx2d = Graphics2D.CreateFromImage(actualImage); this.painter = new AggCanvasPainter((ImageGraphics2D)gfx2d); needUpdate = true; this.BackColor = Color.White; }
public abstract void Draw(PixelFarm.Agg.Graphics2D gx);
public virtual void OnDraw(Graphics2D graphics2D) { }
public static void FillRectangle(this Graphics2D gx, RectInt rect, Color fillColor) { gx.FillRectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, fillColor); }
public static void Rectangle(this Graphics2D gx, RectD rect, Color color, double strokeWidth = 1) { gx.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, color, strokeWidth); }
public static void Rectangle(this Graphics2D gx, RectInt rect, Color color) { gx.Rectangle(rect.Left, rect.Bottom, rect.Right, rect.Top, color); }
public static void Circle(this Graphics2D g, Vector2 origin, double radius, Color color) { Circle(g, origin.x, origin.y, radius, color); }
public static void FillRectangle(this Graphics2D gx, Vector2 leftBottom, Vector2 rightTop, Color fillColor) { gx.FillRectangle(leftBottom.x, leftBottom.y, rightTop.x, rightTop.y, fillColor); }
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); }
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); }