/**
  * Set the density scale at which this drawable will be rendered. This method assumes the drawable
  * will be rendered at the same density as the specified canvas.
  *
  * @param canvas The Canvas from which the density scale must be obtained.
  * @see android.graphics.Bitmap#setDensity(int)
  * @see android.graphics.Bitmap#getDensity()
  */
 public void setTargetDensity(Canvas canvas) {
   setTargetDensity(canvas.getDensity());
 }
 private void setTargetDensity(Canvas paramCanvas) {
   setTargetDensity(paramCanvas.getDensity());
 }
Beispiel #3
0
 public void a(Canvas paramCanvas)
 {
   b(paramCanvas.getDensity());
 }
 /**
  * Converts pt units to pixels on a given canvas (1 pt = 1/72 inch).
  *
  * @param pts number of pt units to convert
  * @param canvas that is used for pixel density
  * @return number of pixels matching 'pts' pt units
  */
 private float ptsToPixels(float pts, Canvas canvas) {
   if (canvas == null || canvas.getDensity() == Bitmap.DENSITY_NONE) {
     return pts;
   }
   return canvas.getDensity() * pts / 72f;
 }