============ Problem Description ============
Brushes, defining drawing Properties private paint mypaint;private paint mbitmappaint;// drawing Paths Private path myPath;// Canvas and its underlying bitmap private bitmap mybitmap0;private bitmap mybitmap1;private canvas mycanvas;public mypaintview (context context, attributeset attrs) {super ( Context, attrs) mybitmap0 = bitmapfactory.decodefile ("/storage/sdcard/a.png"). Copy ( Bitmap.config.argb_8888, true); Mybitmap1 = bitmap.createbitmap (MYBITMAP0); if (i == 0) { Initialize ();} Else if (i == 1) {initwhite ();} Turn on thread new thread (this). Start ();} Public void initialize () {// draw the free curve with the brush mypaint = new paint (); MyPaint.setAntiAlias (true); Mypaint.setdither (true); Mypaint.setcolor (Rgbcolor.getcolor ()); Mypaint.setstyle (Paint.Style.STROKE); Mypaint.setstrokejoin (Paint.Join.ROUND); Mypaint.setstrokecap (Paint.Cap.ROUND); Mypaint.setstrokewidth ( Rgbcolor.getfontsize ()); Mypath = new path(); Mbitmappaint = new paint (Paint.dither_flag);} @Overrideprotected void ondraw (Canvas canvas) {Super.ondraw (Canvas);// background color Canvas.drawcolor (r.color.white); canvas.drawbitmap (Mybitmap1, 0, 0, mbitmappaint); Canvas.drawPath (MyPath, mypaint); Mycanvas = new canvas (MYBITMAP1);} /*** Picture Rotation * */public void picpost (int npostextent) {matrix.reset (); Matrix.postscale (Scale, scale); Matrix.postrotate (npostextent); // the following sentence if the myBitmap1 are changed to myBitmap0 words clockwise and counterclockwise rotation is not a problem, now need to use MYBITMAP1, because the bitmap above the first doodle and then rotate the words will be emptied of the previous graffiti content, So choose MyBitmap1, but with its words can only be rotated in one direction, first clockwise, counter-clockwise will not return to Mybitmap1 = bitmap.createbitmap (mybitmap1, 0, 0, mybitmap1.getwidth (), mybitmap1.getheight (), matrix, true);}
============ Solution 1============
Oh, not a 90-degree angle, 45-degree angle that's not coming back. Because the picture is constantly getting bigger, the upper right corner is constantly filling the white area.
Save the path, the basemap is unchanged, each drawing is a basemap +path
or draw the path on a canvas and put the basemap on the other bitmap, two overlays.
Android Bitmap rotation problem