背景地图的构建(1)
public static Bitmap resizeBitmap(Bitmap bitmap, int w, int h) {if (bitmap != null) {int width = bitmap.getWidth();int height = bitmap.getHeight();int newWidth = w;int newHeight = h;float scaleWidth = ((float) newWidth) / width;float scaleHeight = ((float) newHeight) / height;Matrix matrix = new Matrix();//矩阵映射matrix.postScale(scaleWidth, scaleHeight);Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, width,height, matrix, true);return resizedBitmap;} else {return null;}}
? ? ? ? ? ? ? ?5.得到Canvas画布,利用Canvas.drawBitmap方法把图片画上去,这样就能得到合适的图片了? ? ? ? ? ? ?
?
?
?