Change DPI of QImage / Qt

If you want to change dpi for example for 96 dpi per inch you should use this method:

 
const double dpi = 96 / 0.0254;
img.setDotsPerMeterX(dpi);
img.setDotsPerMeterY(dpi);

About the author

Szymon Wójtowicz

Programista C++/Qt. Tworzący aplikacje mobilne i desktopowe.

View all posts

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *