Return to Snippet

Revision: 38543
at January 5, 2011 00:55 by adrianparr


Initial Code
function inchesToPixels(inches:Number):uint
{
   return Math.round(Capabilities.screenDPI * inches);
}


var myWidthInInches:Number = 1.5;
var myWidthInPixels:uint = inchesToPixels(myWidthInInches);
trace("myWidthInPixels: "+myWidthInPixels);

// OUTPUT
// myWidthInPixels: 108

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

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

Initial Title
AS3 Inches to Pixels

Initial Tags


Initial Language
ActionScript 3