• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps surfaceview read image, edit and save as jpg

golpe

Newbie
Hi

I want to edit a jpg picture and write it back to storage. For this I created an app with surface view. The program loads a picture scaled by 2 so that editing is easier. It remembers all editing and at the end it reloads the same image unscaled into another (?) canvas and replays all editing taking into account scaling and writes the result to disk.

I have tried many versions. Many of them do not work at all and are incomplete. This version works in prnciple but no editing visible on the resulting picture, just the image.

Main questions:

1) why is onDraw in SurfaceView never called?

2) how do I attach a canvas to the bitmap. It seems that I need a View to draw on the unscaled picture. Where to get it? I do not fully understand the mechanics between the canvas and the bitmap.

Please provide me only with simple and really working solutions.

Many thanks for your help.
golpe

here code extracts:
 

Attachments

Back
Top Bottom