public override void FillRenderVx(Brush brush, RenderVx renderVx) { //TODO: review brush implementation here WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.FillPath(_gfx, wRenderVx.path, this.FillColor); }
protected override void OnInitGLProgram(object sender, EventArgs args) { int max = Math.Max(this.Width, this.Height); canvas2d = CreateCanvasGL2d(max, max); painter = new GLCanvasPainter(canvas2d, max, max); polygon1 = painter.CreatePolygonRenderVx(new float[] { 0, 50, 50, 50, 10, 100 }); polygon2 = painter.CreatePolygonRenderVx(new float[] { 200, 50, 250, 50, 210, 100 }); polygon3 = painter.CreatePolygonRenderVx(new float[] { 400, 50, 450, 50, 410, 100 }); }
public override void DrawRenderVx(RenderVx renderVx, float x, float y) { //TODO: review here //temp here var vxFormattedString = renderVx as WinGdiRenderVxFormattedString; if (vxFormattedString != null) { _gdigsx.DrawText(vxFormattedString.InternalBuffer, (int)x, (int)y); } else { var svxRenderVx = renderVx as PixelFarm.Agg.VxsRenderVx; if (svxRenderVx != null) { //TODO: review fill color here _gdigsx.FillPath(svxRenderVx); } else { var svgRenderVx = renderVx as Agg.SvgRenderVx; _gdigsx.FillPath(svgRenderVx); } } }
public override void FillRenderVx(Brush brush, RenderVx renderVx) { //TODO: review brush implementation here WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.FillPath(_skCanvas, wRenderVx.path, _fill); }
public override void DrawRenderVx(RenderVx renderVx, float x, float y) { if (renderVx is DrawingGL.GLRenderVxFormattedString) { DrawingGL.GLRenderVxFormattedString formattedString = (DrawingGL.GLRenderVxFormattedString)renderVx; var prevColor = painter1.FillColor; painter1.FillColor = PixelFarm.Drawing.Color.Black; painter1.TextPrinter.DrawString(formattedString, x, this.Height - y); painter1.FillColor = prevColor; } }
protected override void OnReadyForInitGLShaderProgram() { InstalledTypefaceCollection collection = new InstalledTypefaceCollection(); collection.LoadSystemFonts(); InstalledTypeface tahomaFont = collection.GetInstalledTypeface("tahoma", TypefaceStyle.Regular); FontFace tahomaFace = OpenFontLoader.LoadFont(tahomaFont.FontPath); ActualFont actualFont = tahomaFace.GetFontAtPointSize(72); FontGlyph glyph = (FontGlyph)actualFont.GetGlyph('K'); _glyph_vx = _painter.CreateRenderVx(_tempSnap1 = glyph.flattenVxs); _linearGrBrush2 = new LinearGradientBrush( new PointF(0, 0), new PointF(100, 100), Color.Red, Color.Black); }
// PixelFarm.Drawing.Fonts.SvgFontStore svgFontStore = new PixelFarm.Drawing.Fonts.SvgFontStore(); protected override void OnInitGLProgram(object sender, EventArgs args) { //temp*** int max = Math.Max(this.Width, this.Height); canvas2d = PixelFarm.Drawing.GLES2.GLES2Platform.CreateCanvasGL2d(max, max); painter = new GLCanvasPainter(canvas2d, max, max); //---------------------- var win32InstallFontProvider = new PixelFarm.Drawing.InstallFontsProviderWin32(); InstalledFontCollection collection = new InstalledFontCollection(); collection.LoadInstalledFont(win32InstallFontProvider.GetInstalledFontIter()); InstalledFont tahomaFont = collection.GetFont("tahoma", InstalledFontStyle.Regular); FontFace tahomaFace = OpenFontLoader.LoadFont(tahomaFont.FontPath, ScriptLangs.Latin); ActualFont actualFont = tahomaFace.GetFontAtPointsSize(72); FontGlyph glyph = actualFont.GetGlyph('K'); //var svgFont = svgFontStore.LoadFont("svg-LiberationSansFont", 300); ////PathWriter p01 = new PathWriter(); ////p01.MoveTo(0, 0); ////p01.LineTo(50, 100); ////p01.LineTo(100, 0); //////- ////p01.MoveTo(220, 10); ////p01.LineTo(50, 75); ////p01.LineTo(25, 15); ////p01.CloseFigure(); ////p01.Stop(); ////m_pathVxs = p01.Vxs; //var m_pathVxs = svgFont.GetGlyph('K').originalVxs;// typeFaceForLargeA.GetGlyphForCharacter('a'); ////m_pathVxs = MergeFontSubFigures(m_pathVxs); //Affine shape_mtx = Affine.NewMatix(AffinePlan.Translate(150, 100)); //m_pathVxs = shape_mtx.TransformToVxs(m_pathVxs); //var curveFlattener = new CurveFlattener(); //var m_pathVxs2 = curveFlattener.MakeVxs(m_pathVxs); glyph_vx = painter.CreateRenderVx(tempSnap1 = new PixelFarm.Agg.VertexStoreSnap(glyph.flattenVxs)); linearGrBrush2 = new LinearGradientBrush( new PointF(0, 0), Color.Red, new PointF(100, 100), Color.Black); //---------------------- }
public override void FillRenderVx(Brush brush, RenderVx renderVx) { AggRenderVx aggRenderVx = (AggRenderVx)renderVx; //fill with brush if (brush is SolidBrush) { SolidBrush solidBrush = (SolidBrush)brush; var prevColor = this.fillColor; this.fillColor = solidBrush.Color; Fill(aggRenderVx.snap); this.fillColor = prevColor; } else { Fill(aggRenderVx.snap); } }
protected override void OnReadyForInitGLShaderProgram() { _polygon1 = _painter.CreatePolygonRenderVx(new float[] { 0, 50, 50, 50, 10, 100 }); _polygon2 = _painter.CreatePolygonRenderVx(new float[] { 200, 50, 250, 50, 210, 100 }); _polygon3 = _painter.CreatePolygonRenderVx(new float[] { 400, 50, 450, 50, 410, 100 }); }
protected override void OnReadyForInitGLShaderProgram() { using (Tools.BorrowVxs(out var v1, out var v2, out var v3)) using (Tools.BorrowPathWriter(v1, out PathWriter p)) { p.MoveTo(0, 50); p.LineTo(50, 50); p.LineTo(10, 100); p.CloseFigure(); _polygon1 = _painter.CreateRenderVx(v1.CreateTrim()); AffineMat tx = AffineMat.Iden(); tx.Translate(200, 0); tx.TransformToVxs(v1, v2); //v1=>v2 _polygon2 = _painter.CreateRenderVx(v2.CreateTrim()); tx.TransformToVxs(v2, v3); //v2=>v3 _polygon3 = _painter.CreateRenderVx(v3.CreateTrim()); } }
protected override void OnReadyForInitGLShaderProgram() { InstalledFontCollection collection = new InstalledFontCollection(); collection.LoadSystemFonts(); InstalledFont tahomaFont = collection.GetFont("tahoma", InstalledFontStyle.Normal); FontFace tahomaFace = OpenFontLoader.LoadFont(tahomaFont.FontPath); ActualFont actualFont = tahomaFace.GetFontAtPointSize(72); FontGlyph glyph = (FontGlyph)actualFont.GetGlyph('K'); //var svgFont = svgFontStore.LoadFont("svg-LiberationSansFont", 300); ////PathWriter p01 = new PathWriter(); ////p01.MoveTo(0, 0); ////p01.LineTo(50, 100); ////p01.LineTo(100, 0); //////- ////p01.MoveTo(220, 10); ////p01.LineTo(50, 75); ////p01.LineTo(25, 15); ////p01.CloseFigure(); ////p01.Stop(); ////m_pathVxs = p01.Vxs; //var m_pathVxs = svgFont.GetGlyph('K').originalVxs;// typeFaceForLargeA.GetGlyphForCharacter('a'); ////m_pathVxs = MergeFontSubFigures(m_pathVxs); //Affine shape_mtx = Affine.NewMatix(AffinePlan.Translate(150, 100)); //m_pathVxs = shape_mtx.TransformToVxs(m_pathVxs); //var curveFlattener = new CurveFlattener(); //var m_pathVxs2 = curveFlattener.MakeVxs(m_pathVxs); glyph_vx = painter.CreateRenderVx(tempSnap1 = new PixelFarm.Drawing.VertexStoreSnap(glyph.flattenVxs)); linearGrBrush2 = new LinearGradientBrush( new PointF(0, 0), Color.Red, new PointF(100, 100), Color.Black); //---------------------- }
public override void DrawRenderVx(RenderVx renderVx) { _glsx.DrawRenderVx(_strokeColor, renderVx); }
public abstract void DrawRenderVx(RenderVx renderVx);
public abstract void FillRenderVx(Brush brush, RenderVx renderVx);
public override void DrawRenderVx(RenderVx renderVx, float x, float y) { throw new System.NotImplementedException(); }
public override void DrawRenderVx(RenderVx renderVx) { _canvas.DrawRenderVx(_strokeColor, renderVx); }
public override void FillRenderVx(Brush brush, RenderVx renderVx) { _glsx.FillRenderVx(brush, renderVx); }
public override void FillRenderVx(RenderVx renderVx) { AggRenderVx aggRenderVx = (AggRenderVx)renderVx; Fill(aggRenderVx.snap); }
public override void DrawRenderVx(RenderVx renderVx) { AggRenderVx aggRenderVx = (AggRenderVx)renderVx; Draw(aggRenderVx.snap); }
public abstract void FillRenderVx(RenderVx renderVx);
public override void DrawRenderVx(RenderVx renderVx) { WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.DrawPath(_skCanvas, wRenderVx.path, _stroke); }
public override void FillRenderVx(Brush brush, RenderVx renderVx) { _canvas.FillRenderVx(brush, renderVx); }
public override void FillRenderVx(RenderVx renderVx) { _glsx.FillRenderVx(_fillColor, renderVx); }
public override void FillRenderVx(Brush brush, RenderVx renderVx) { throw new NotImplementedException(); }
public override void FillRenderVx(RenderVx renderVx) { WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.FillPath(_skCanvas, wRenderVx.path, _fill); }
public override void FillRenderVx(RenderVx renderVx) { _canvas.FillRenderVx(_fillColor, renderVx); }
public abstract void DrawRenderVx(RenderVx renderVx, float x, float y);
public override void DrawRenderVx(RenderVx renderVx) { WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.DrawPath(_gfx, wRenderVx.path, this._strokeColor); }
public override void Render(RenderVx renderVx) { throw new NotImplementedException(); }
public override void FillRenderVx(RenderVx renderVx) { WinGdiRenderVx wRenderVx = (WinGdiRenderVx)renderVx; VxsHelper.FillPath(_gfx, wRenderVx.path, this.FillColor); }