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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -