Android Question Zoom Drawing

Terradrones

Active Member
Hi All

I need help\push again please.

I am using the graphic functions in B4A to plot my Horizontal Alignments, Vertical Alignment, TIN Models, etc.

Without going into heavy Maths, is there an easy way to zoom in and out of a drawing? Or maybe zoom into an area defined by a window?

Not Bitmaps, but a drawing consisting of Lines, Arcs, Text, etc.

By the way, I solved my problem in a previous post, where I could not plot my Horizontal Alignment.

Thanks
Michael
 

drgottjr

Expert
Licensed User
Longtime User
i revisit an unresolved zooming problem periodically.

if you don't want to use a scaled bitmap, then a canvas is what you would draw on.
rects will capture the relevant portion of the original drawing (presumably a bitmap).
enter the heavy maths when it comes time to scale up. once you've computed
the rescaled relevant x's and y's from the original, you draw them on the canvas.

resizing a bitmap (or portion thereof) is easiest (if not the most pleasing effect),
but you run the risk of exhausting device memory depending on how you go
about things.

check the thread appearing below this one regarding scaled bitmaps. canvas is the
answer for drawing, but bitmaps could work depending on your use case.
 
Upvote 0
Top