Java tutorial
//package com.java2s; //License from project: Apache License import android.graphics.Bitmap; import android.graphics.PointF; public class Main { public static PointF drawBitmapOffset(PointF center, Bitmap bitmap) { PointF offset = new PointF(); if (bitmap == null || bitmap.getWidth() < 0) { return center; } offset.set(center.x - bitmap.getWidth() / 2, center.y - bitmap.getHeight() / 2); return offset; } }