In WinForms (preferable C#), how could I make a simple "zoom" tool to show a rectangle-view below cursor position? Ideally, only zooming in over controls (buttons, labels…)
Although, first at all, Is this possible with the standard libraries (.dll)? I'm completely newbie in working with graphics…
Thanks in advance!
Edit: This question/answer (Zoom a Rectangle in .NET) treats about zooming images, not input controls. I just want to zoom the control.
Edit2: Through MouseEnter event for each control I position a panel which should contain the image of the control enlarged. I only get the panel in right site…
private void anyControl_MouseEnter(object sender, EventArgs e)
{
Bitmap printscreen = new Bitmap(Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height);
//Create the Graphic Variable with screen Dimensions
Graphics graphics = Graphics.FromImage(printscreen as Image);
//Copy Image from the screen
graphics.CopyFromScreen(0, 0, 0, 0, printscreen.Size);
Control auxControl = (Control) sender;
panel.Width = auxControl + 20;
panel.Height = auxControl + 20;
panel.Location = new Point (auxControl.Location.X - 10, auxControl.Location.Y - 10);
control.DrawToBitmap(printscreen, panel.Bounds)
}