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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -