SyntaxFix
Write A Post
Hire A Developer
Questions
The Resource class also has a method getDimensionPixelSize() which I think will fit your needs.
Resource