I have a graph that I am using from a package, but I made a custom control that would hover with your mouse and tell you the Y values according to the mouse's position relative to X on this pre-made graph control. If you click on the control, it will "paste" my control onto the graph. The graph can be exported as a .bmp, but since my control is not part of the graph, it does not get exported.
Thanks.
Edited byhiggernautWednesday, November 04, 2009 9:48 PM
public Image GetImageOfControl(Control c)
{
Rectangle rc = new Rectangle(this.PointToScreen(c.Location), c.Size);
Image i = new Bitmap(rc.Width, rc.Height);
Graphics g = Graphics.FromImage(i);
g.CopyFromScreen(rc.Left, rc.Top, 0, 0, rc.Size);
g.Dispose();
return i;
}
Marked As Answer byhiggernautTuesday, November 03, 2009 7:33 PM
public Image GetImageOfControl(Control c)
{
Rectangle rc = new Rectangle(this.PointToScreen(c.Location), c.Size);
Image i = new Bitmap(rc.Width, rc.Height);
Graphics g = Graphics.FromImage(i);
g.CopyFromScreen(rc.Left, rc.Top, 0, 0, rc.Size);
g.Dispose();
return i;
}
Marked As Answer byhiggernautTuesday, November 03, 2009 7:33 PM