Skip to content

Instantly share code, notes, and snippets.

@omegasoft7
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omegasoft7/a4c76042481bbf0d9ce1 to your computer and use it in GitHub Desktop.
Save omegasoft7/a4c76042481bbf0d9ce1 to your computer and use it in GitHub Desktop.
Calculate Pixcels by getting DP
// this will calculate and return Pixel value by getting DP value
public static int getDPbyPixcel(int pix) {
return (int) (pix * HYGlobal.density + 0.5f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment