vendredi 13 mars 2015

Howto findout how many pixels are one centimeter in ios (swift)


Vote count:

0




I would like to draw a line with exact one centimeter on any IOS Device. How can I get the pixels for one centimeter ?


In Android and Java I would do something like following:



public float getPixelsperCentimeter(){
float finchpercm = 1.0f / 2.54f;
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);

return metrics.densityDpi * finchpercm ;
}


asked 2 mins ago







Howto findout how many pixels are one centimeter in ios (swift)

Aucun commentaire:

Enregistrer un commentaire