I am trying to create an image save and retrieve feature in android. The code I have for creating a jpg file from canvas is as below
Bitmap bitmap = Bitmap.createBitmap( view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); view.draw(canvas); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); I am trying to read the jpg file and create image on canvas using
Bitmap bMap = BitmapFactory.decodeStream(buf); Bitmap workingBitmap = Bitmap.createBitmap(bMap); Bitmap mutableBitmap = workingBitmap.copy(Bitmap.Config.ARGB_8888, true); view.mybitmap = mutableBitmap; view.onDraw(view.Canvas); The code I have in onDraw is
canvas.drawBitmap(view.mybitmap, 0, 0, view.myPaint); This draws the bitmap on canvas correctly from the stored jpg file but I am not able to draw anything on the canvas after that. Has it loaded a immutable bitmap image on canvas which I am not able to edit?
Any help will be appreciated! Thanks!