public override void DrawRect(RectangleF dirtyRect) { base.DrawRect(dirtyRect); using (CGContext graph = NSGraphicsContext.CurrentContext.GraphicsPort) using (CocoaGraphDrawer drawer = new CocoaGraphDrawer(graph, BaseGraph.Width, BaseGraph.Height)) { BaseGraph.DrawFullGraph(drawer); } }
private void Graph_Paint(object sender, PaintEventArgs e) { if (BaseGraph != null) { using (Bitmap bmp = new Bitmap(this.Width, this.Height, PixelFormat.Format24bppRgb)) using (WinFormGraphDrawer drawer = new WinFormGraphDrawer(MainPanel.CreateGraphics(), Graphics.FromImage(bmp), bmp)) { BaseGraph.DrawFullGraph(drawer); } } }
protected void OnGraphEventBoxExposeEvent(object o, ExposeEventArgs args) { if (((DrawingArea)o).GdkWindow != null) { using (ImageSurface tmpSurface = new ImageSurface(Format.Rgb24, ((DrawingArea)o).Allocation.Width, ((DrawingArea)o).Allocation.Height)) using (GtkGraphDrawer drawer = new GtkGraphDrawer(Gdk.CairoHelper.Create(((DrawingArea)o).GdkWindow), new Context(tmpSurface), tmpSurface)) { BaseGraph.DrawFullGraph(drawer); } } }