Android Question Zoom into part of a canvas

piedy

Member
Licensed User
Longtime User
Hi,

I have a canvas which contains a lot of drawing. I would like to zoom in to a part of the canvas. Is there an easy way of doing this? I thought about having an offscreen canvas, drawing a part of the original, and then flipping the canvases. Is this the right way of achieving this?

Very many thanks in advance.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Make all your drawings on a mutable bitmap and then draw this bitmap to the view (with the second canvas). This will allow you to "stretch" the image.

Another option which may yield better results but is a bit more complicated is to make all the drawings scalable. Create a "scale" parameter and multiply all the values (positions and sizes) with this scale. It will allow you to change the scale parameter and zoom in or out.
 
Upvote 0
Top