how to calculate offset of image code example
Example: offset calculation for images
offsetFactor = (1.0 - scale) / 2;
dx = originalWidth * offsetFactor;
dy = originalHeight * offsetFactor;
offsetFactor = (1.0 - scale) / 2;
dx = originalWidth * offsetFactor;
dy = originalHeight * offsetFactor;