1
I’m using the Control.MousePosition
to get the mouse coordinates in windows 10.
Then use the following function to get a Printscreen:
public static Bitmap PrintScreen(Point Source,Point Destination)
{
Rectangle R = new Rectangle(Source.X, Source.Y, Destination.X - Source.X, Destination.Y - Source.Y);
Bitmap printscreen = new Bitmap(R.Width,R.Height);
Graphics graphics = Graphics.FromImage(printscreen as Image);
graphics.CopyFromScreen(R.Left,R.Top,0,0, printscreen.Size);
graphics.Dispose();
return printscreen;
}
My problem is that the source is with 125%
and when I send the coordinates of mouse position to obtain the printscreen it goes to the "real" coordinates, this is without the Scale.
How to solve the problem?
My screen has the resolution of 1920*1080. But when I put in the right end the Control.Mouseposition Returns 1535 instead of 1920...
– Leandro Rodrigues
Zoom will always be set at 125%?
– Randrade
Not always. It can be changed. And in this case I wanted to make sure it would work anyway. If it was fixed, just multiply by 1.25
– Leandro Rodrigues
Just to clarify, what do you mean by the source is 125%? What you’re considering as this "source"?
– Randrade
I think it’s that Windows zoom, @Randrade. That’s right, Leandro?
– Jéf Bueno
@jbueno I also imagined this, but it wasn’t clear.
– Randrade
@Randrade your interpretation is correct. The source is 125%
– Leandro Rodrigues
@Leandrorodrigues Did the answer solve your problem? Do you think you can accept it? If you don’t know how you do it, see [tour]. This would help a lot to indicate that the solution was useful to you and to give an indication that there was a satisfactory solution. You can also vote on any question or answer you find useful on the entire site.
– Maniero