# createSnapshotOfNativeWindow on non 1.0 scale mode (higher DPI)

**URL:** <https://forum.juce.com/t/createsnapshotofnativewindow-on-non-1-0-scale-mode-higher-dpi/32908>\
**Category:** Windows\
**Created:** [April 17, 2019, 5:14pm UTC](https://forum.juce.com/t/createsnapshotofnativewindow-on-non-1-0-scale-mode-higher-dpi/32908 "2019-04-17T17:14:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilliamkWusik](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/williamkwusik/32/3821_2.png) [@WilliamkWusik](https://forum.juce.com/u/WilliamkWusik)\
**Post date:** [April 17, 2019, 5:14pm UTC](https://forum.juce.com/t/createsnapshotofnativewindow-on-non-1-0-scale-mode-higher-dpi/32908/1 "2019-04-17T17:14:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [April 18, 2019, 11:51am UTC](https://forum.juce.com/t/createsnapshotofnativewindow-on-non-1-0-scale-mode-higher-dpi/32908/2 "2019-04-18T11:51:46Z")

</div>

[This commit](https://github.com/WeAreROLI/JUCE/commit/3eb4cfec9a84aeb6a395983b9b01cfc88084d2b9) should get the image resized correctly so it’s in logical pixels instead of physical pixels, but it uses `StretchBlt()` which will still rescale so it will look blurry at higher scale factors. I’m not sure if there’s even a way for us to get a high-DPI image using the GDI methods unfortunately.

---

<div class="post-metadata">

**Author:** ![WilliamkWusik](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/williamkwusik/32/3821_2.png) [@WilliamkWusik](https://forum.juce.com/u/WilliamkWusik)\
**Post date:** [April 18, 2019, 1:32pm UTC](https://forum.juce.com/t/createsnapshotofnativewindow-on-non-1-0-scale-mode-higher-dpi/32908/3 "2019-04-18T13:32:45Z")

</div>

Thank you so much, will test it out today. 🙂

Cheers
