I am testing the size of a image and I need to have the same size across all monitors

i73

Member
Joined
Sep 27, 2016
Messages
5
Programming Experience
3-5
I have an image that needs to stay 5 inches no matter what the resolution is on their monitor, could be HD could be 4k. <br>
I am forgetting the formula to allow me to keep the size of a image the same across all devices. I am getting the screen bounds and I have the image :<br>
<br>
C#:
<br><font color="#2B91AF"><span style="font-family: Consolas">Rectangle</span></font><font color="#303336"><span style="font-family: Consolas"> resolution </span></font><font color="#303336"><span style="font-family: Consolas">=</span></font><font color="#2B91AF"><span style="font-family: Consolas">Screen</span></font><font color="#303336"><span style="font-family: Consolas">.</span></font><font color="#2B91AF"><span style="font-family: Consolas">PrimaryScreen</span></font><font color="#303336"><span style="font-family: Consolas">.</span></font><font color="#2B91AF"><span style="font-family: Consolas">Bounds</span></font><font color="#303336"><span style="font-family: Consolas">;<br>
</span></font><font color="#009999"><span style="font-family: Consolas">Image</span></font><font color="#000000"><span style="font-family: Consolas"> myImg = </span></font><font color="#009999"><span style="font-family: Consolas">Image</span></font><font color="#000000"><span style="font-family: Consolas">.FromFile(</span></font><font color="#CC0000"><span style="font-family: Consolas">"myImageThatHasToBe5Inches"</span></font><font color="#000000"><span style="font-family: Consolas">);<br>//Whats the formula to keep it 5 inches? <br></span></font>
<br>
<br>Or is there a function I can use to always display the image a certain size? <br>
Can you help me?
 
Back
Top Bottom