c# - Graphics CopyFromScreen off when font/icon scaling is enabled -


need c# windows forms program. on .net 4.0.

i use following (snippet of) code capture composited image window:

var location = pointtoscreen(picvisualizer.location); ... g.copyfromscreen(location, new point(0, 0), picvisualizer.size, copypixeloperation.sourcecopy); 

picvisualizer picturebox control in window. works intended, long user keeps windows font/icon scaling @ 100%. if change, image captured right size offset, capturing part of window, desktop, etc.

i've tried variety of solutions give me same location value, end result same. i've tried autoscalemode none, font, dpi , inherit, , 4 gave me same result.

is there way tweak code it'll capture correct part of screen when display scaling not @ 100%?

thanks.

the answer suggested blorgbeard works beautifully.

picvisualizer.drawtobitmap(bitmap, picvisualizer.clientrectangle); 

thanks.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -