/**bitmap Amplification Method */
private static Bitmap big (Bitmap Bitmap) {
Matrix matrix = new Matrix ();
Matrix.postscale (1.5f,1.5f); Ratio of long and wide magnification reduction
Bitmap resizebmp = Bitmap.createbitmap (Bitmap,0,0,bitmap.getwidth (), Bitmap.getheight (), matrix,true);
return resizebmp;
}
/**bitmap Reduction Method */
private static Bitmap Small (Bitmap Bitmap) {
Matrix matrix = new Matrix ();
Matrix.postscale (0.8f,0.8f); Ratio of long and wide magnification reduction
Bitmap resizebmp = Bitmap.createbitmap (Bitmap,0,0,bitmap.getwidth (), Bitmap.getheight (), matrix,true);
return resizebmp;
}
Drawing pictures
int savecount = Canvas.getsavecount ();
Canvas.save ();
Canvas.translate (Pleft, ptop); Canvas Brush Start position
if (Item.matrix! = null) {
Canvas.concat (Item.matrix); Adding matrix matrices to the canvas
}
Set the area where the graph is drawn, and the drawing area parameters of the picture will be zoomed in and out with the scale of the matrix parameter, for example, if the drawing starting point is 100px and matrix.scale=0.5
The drawing start point in the actual drawing is at 50px.
Canvas.cliprect (Item.rect);
Draw three Photos
The draw start position in Canvas.drawbitmap () zooms in and out with the scale of the matrix parameter, for example, if the drawing starting point is 100px at the same time matrix.scale=0.5
The drawing start point in the actual drawing is at 50px.
Canvas.drawbitmap (Item.bitmap,
Item.rect.left, Item.rect.top, Mpaint);
Canvas.restoretocount (Savecount);
Android Image zoom out and zoom matrix