Get image from chart control


Author
Message
Elvira Aminova
Elvira Aminova
Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)
Group: Forum Members
Posts: 10, Visits: 1
I want to capture an image from NChartControl and then display it on the form.

I tried this:

//I add control to the form
System.Windows.Forms.Control control = new System.Windows.Forms.Control();
System.Drawing.Graphics g = control.CreateGraphics();

//control size is 100 to 100
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(100,100,g);
chart.ImageExporter.RenderToBitmap(bitmap, false);

I expected to see chart image on the control. Instead of that I see white rectangle.

What I did wrong?
Is it mistake to use System.Windows.Forms.Control to display an image on it?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search