createSnapshotOfNativeWindow works great, but if you are using scale higher than 100% this will return a larger image, and rescaling makes it looks blurry. Even when using Graphics::ResamplingQuality::highResamplingQuality
Image tempImage = createSnapshotOfNativeWindow(childWindowHandle);
if (tempImage.isValid() && tempImage.getWidth() > 0)
{
lastScreenshot = tempImage;
//
if (isDPIAware)
{
if (scaleFactor != 1.0f)
lastScreenshot = tempImage.rescaled(getWidth(), getHeight() - yPos, Graphics::ResamplingQuality::highResamplingQuality);
}
else
{
if (lastScreenshot.getWidth() != getWidth() || lastScreenshot.getHeight() != (getHeight() - yPos))
lastScreenshot = tempImage.rescaled(getWidth(), getHeight() - yPos, Graphics::ResamplingQuality::highResamplingQuality);
}
}
So I wonder if there’s an alternative way to handle this. I’m trying to get the contents of my bridged external process window.
Cheers, WilliamK