Posted By

adrianparr on 01/05/11


Tagged

dpi pixel size resolution as3 pixels PPI density multiscreen mm millimeters


Versions (?)

AS3 Millimeters to Pixels


 / Published in: ActionScript 3
 

URL: http://www.adobe.com/devnet/flash/articles/authoring_for_multiple_screen_sizes.html

This is taken from Christian Cantrell's Adobe article called 'Authoring mobile Flash content for multiple screen sizes'.

  1. function mmToPixels(mm:Number):uint
  2. {
  3. return Math.round(Capabilities.screenDPI * (mm / 25.4));
  4. }
  5.  
  6.  
  7. var myWidthInMillimeters:Number = 38;
  8. var myWidthInPixels:uint = mmToPixels(myWidthInMillimeters);
  9. trace("myWidthInPixels: "+myWidthInPixels);
  10.  
  11. // OUTPUT
  12. // myWidthInPixels: 108

Report this snippet  

You need to login to post a comment.