BUG-1965: Fixed a bug where a 1 pixel wide border around an active window is visible. Probably due to the "shadow" being captured too.

This commit is contained in:
Robin 2016-05-22 00:16:06 +02:00
parent d25021631e
commit 1469f1fa41
9 changed files with 200 additions and 179 deletions

View file

@ -77,10 +77,10 @@ namespace GreenshotPlugin.Controls {
SIZE sourceSize;
DWM.DwmQueryThumbnailSourceSize(_thumbnailHandle, out sourceSize);
int thumbnailHeight = 200;
int thumbnailWidth = (int)(thumbnailHeight * ((float)sourceSize.width / (float)sourceSize.height));
int thumbnailWidth = (int)(thumbnailHeight * ((float)sourceSize.Width / (float)sourceSize.Height));
if (parentControl != null && thumbnailWidth > parentControl.Width) {
thumbnailWidth = parentControl.Width;
thumbnailHeight = (int)(thumbnailWidth * ((float)sourceSize.height / (float)sourceSize.width));
thumbnailHeight = (int)(thumbnailWidth * ((float)sourceSize.Height / (float)sourceSize.Width));
}
Width = thumbnailWidth;
Height = thumbnailHeight;