# How to set DPI scale factor properly for pixel drawing?

**URL:** <https://forum.juce.com/t/how-to-set-dpi-scale-factor-properly-for-pixel-drawing/39570>\
**Category:** Development\
**Created:** [May 20, 2020, 8:37am UTC](https://forum.juce.com/t/how-to-set-dpi-scale-factor-properly-for-pixel-drawing/39570 "2020-05-20T08:37:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiandingzhe](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@jiandingzhe](https://forum.juce.com/u/jiandingzhe)\
**Post date:** [May 20, 2020, 8:37am UTC](https://forum.juce.com/t/how-to-set-dpi-scale-factor-properly-for-pixel-drawing/39570/1 "2020-05-20T08:37:55Z")

</div>

I’m making some per-pixel drawing using JUCE: firstly draw results in an `Image` object, then draw the image to component during `paint` callback.

At current, no DPI-aware procedure is made, and I tested high-DPI performance by set scale factor to 200% in Windows display settings. My app window has its size doubled, and the pixel paintings also doubled by direct scaling, so it looks like a non-DPI-aware program that is directly scaled by OS.

How should I configure the components/windows so that I got a scaled component pixel buffer, so I could make a DPI-scaled image object and paint it to target component.

Or I should just simply call `graphics.drawImageTransformed` with `AffineTransform::scale(1.0/dpi_scale)`?
