zoom method

hackhack

Active Member
Licensed User
Longtime User
I have a ... not sure what the right word is - a "view" consisting of some text and graphics.

Ideally i would like this view to be pinch zoomable, so one could zoom in to have a look at something, and then zoom out again to see more.
Its not a huge view, its not a map or something like that, and the information wouldn't update all the time either.

I'm wondering what the best way to implement that is?

Would it be constructing a bitmap in memory and then displaying a piece of that, or is there a better way? Perhaps something androidy I don't know about yet
 

hackhack

Active Member
Licensed User
Longtime User
And that is the only way?

Based on comments here (found via the search engine) it seems to be wildly imprecise.

Can you zoom it from code?

Is it possible to disable the onscreen +/- buttons?

on a different note, is it possible to resize bitmaps from b4a?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
WebView is the only view that natively supports pinch zooming. Using the Gestures library you can implement this feature yourself with other views.
it seems to be wildly imprecise.
From my experience WebView is your best choice. Your experience with it may be different.

You can zoom it from code.
You can disable the +/- buttons.

It is possible to resize bitmaps with Canvas.
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
WebView is the only view that natively supports pinch zooming. Using the Gestures library you can implement this feature yourself with other views.

Hm, but can you zoom other views? Like say a listview ? Doesn't seem to have a zoom level property.

From my experience WebView is your best choice. Your experience with it may be different.

I have very limited experience with it, i just tried the code listed somewhere else here where someone wanted to display a picture in full size at loading, and it wasn't possible. But i'll look into it further, it may well do what i would like.

You can zoom it from code.
You can disable the +/- buttons.

It is possible to resize bitmaps with Canvas.
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
Maybe they are handling the gestures themselves. Using the Gestures library you can handle multitouch gestures. It is not very easy, but still possible.

Thanks, I'll temper the ambitions a bit and wait a while on the zooming
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…