# Pixels per inch

**URL:** <https://discourse.libsdl.org/t/pixels-per-inch/11932>\
**Category:** SDL Development\
**Created:** [February 27, 2005, 9:33pm UTC](https://discourse.libsdl.org/t/pixels-per-inch/11932 "2005-02-27T21:33:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sapsan](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/0ea827/32.png) [@Sapsan](https://discourse.libsdl.org/u/Sapsan)\
**Post date:** [February 27, 2005, 9:33pm UTC](https://discourse.libsdl.org/t/pixels-per-inch/11932/1 "2005-02-27T21:33:25Z")

</div>

Can I get info about pixels per inch on my screen?

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [February 27, 2005, 11:33pm UTC](https://discourse.libsdl.org/t/pixels-per-inch/11932/2 "2005-02-27T23:33:37Z")

</div>

No SDL API for that AFAIK - and even if there was, it wouldn’t be  
reliable.

Applications that really care usually offer the user some way of  
overriding whatever the graphics subsystem says, as that option is  
often abused as a way of scaling fonts system wide. Of course,  
there’s also a rather big risk of the monitor(s) being detected  
incorrectly, and the PPI values being off for that reason.

What do you need it for? What kind of accuracy and reliability do you  
need? If it’s really important, maybe it’s easier, safer and/or  
better to just ask the user?

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.  
| Free/Open Source audio engine for games and multimedia. |  
| MIDI, modular synthesis, real time effects, scripting,… |  
`-----------------------------------\> [http://audiality.org](http://audiality.org) -’  
— [http://olofson.net](http://olofson.net) — [http://www.reologica.se](http://www.reologica.se) —On Sunday 27 February 2005 22.33, Sapsan wrote:

> Can I get info about pixels per inch on my screen?

---

<div class="post-metadata">

**Author:** ![Sapsan](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/0ea827/32.png) [@Sapsan](https://discourse.libsdl.org/u/Sapsan)\
**Post date:** [February 28, 2005, 8:55pm UTC](https://discourse.libsdl.org/t/pixels-per-inch/11932/3 "2005-02-28T20:55:56Z")

</div>

David Olofson wrote:\>On Sunday 27 February 2005 22.33, Sapsan wrote:

> > Can I get info about pixels per inch on my screen?
> 
> What do you need it for? What kind of accuracy and reliability do you  
> need? If it’s really important, maybe it’s easier, safer and/or  
> better to just ask the user?

I want always get constantly sized image independent of resolution,  
monitor size etc.

---

<div class="post-metadata">

**Author:** ![Simon\_Roby](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@Simon\_Roby](https://discourse.libsdl.org/u/Simon_Roby)\
**Post date:** [February 28, 2005, 9:06pm UTC](https://discourse.libsdl.org/t/pixels-per-inch/11932/4 "2005-02-28T21:06:50Z")

</div>

> David Olofson wrote:
> 
> > > Can I get info about pixels per inch on my screen?
> > 
> > What do you need it for? What kind of accuracy and reliability do you  
> > need? If it’s really important, maybe it’s easier, safer and/or  
> > better to just ask the user?
> 
> I want always get constantly sized image independent of resolution,  
> monitor size etc.

You should really just ask the user. Queries about pixel per inch are  
platform-specific, and usually quite unreliable.On Mon, 28 Feb 2005 22:55:56 +0200, Sapsan wrote:

> > On Sunday 27 February 2005 22.33, Sapsan wrote:
