H hackhack Active Member Licensed User Longtime User Jul 23, 2011 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2011 #2 I recommend you to use WebView for this. You can combine text and images and it supports zooming. Upvote 0
H hackhack Active Member Licensed User Longtime User Jul 24, 2011 #3 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
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?
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2011 #4 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. Click to expand... 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
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. Click to expand... 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.
H hackhack Active Member Licensed User Longtime User Jul 24, 2011 #5 Erel said: WebView is the only view that natively supports pinch zooming. Using the Gestures library you can implement this feature yourself with other views. Click to expand... Hm, but can you zoom other views? Like say a listview ? Doesn't seem to have a zoom level property. Erel said: From my experience WebView is your best choice. Your experience with it may be different. Click to expand... 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. Erel said: You can zoom it from code. You can disable the +/- buttons. It is possible to resize bitmaps with Canvas. Click to expand... Upvote 0
Erel said: WebView is the only view that natively supports pinch zooming. Using the Gestures library you can implement this feature yourself with other views. Click to expand... Hm, but can you zoom other views? Like say a listview ? Doesn't seem to have a zoom level property. Erel said: From my experience WebView is your best choice. Your experience with it may be different. Click to expand... 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. Erel said: You can zoom it from code. You can disable the +/- buttons. It is possible to resize bitmaps with Canvas. Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2011 #6 WebView is the only view that natively supports zooming. Upvote 0
H hackhack Active Member Licensed User Longtime User Jul 24, 2011 #7 Erel said: It is possible to resize bitmaps with Canvas. Click to expand... How? When you make a new canvas it copies the bitmap, so if you specify a different size for the canvas the bitmap gets resized? Upvote 0
Erel said: It is possible to resize bitmaps with Canvas. Click to expand... How? When you make a new canvas it copies the bitmap, so if you specify a different size for the canvas the bitmap gets resized?
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2011 #8 Canvas.DrawBitmap allows you to draw bitmaps of any sizes. Upvote 0
H hackhack Active Member Licensed User Longtime User Jul 24, 2011 #9 Erel said: Canvas.DrawBitmap allows you to draw bitmaps of any sizes. Click to expand... Yeah, but i said resize, like loading a jpg and changing its resolution. I'll play with it and see if i can figure it out, thanks. Upvote 0
Erel said: Canvas.DrawBitmap allows you to draw bitmaps of any sizes. Click to expand... Yeah, but i said resize, like loading a jpg and changing its resolution. I'll play with it and see if i can figure it out, thanks.
H hackhack Active Member Licensed User Longtime User Jul 24, 2011 #10 Erel said: From my experience WebView is your best choice. Your experience with it may be different. You can zoom it from code. Click to expand... But only nudge in and out an unspecified amount with WebView.zoom ? Erel said: You can disable the +/- buttons. Click to expand... And retain pinch zoom? Upvote 0
Erel said: From my experience WebView is your best choice. Your experience with it may be different. You can zoom it from code. Click to expand... But only nudge in and out an unspecified amount with WebView.zoom ? Erel said: You can disable the +/- buttons. Click to expand... And retain pinch zoom?
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2011 #11 But only nudge in and out an unspecified amount with WebView.zoom ? Click to expand... That is correct. And retain pinch zoom? Click to expand... No. The user will not be able to zoom the view. Upvote 0
But only nudge in and out an unspecified amount with WebView.zoom ? Click to expand... That is correct. And retain pinch zoom? Click to expand... No. The user will not be able to zoom the view.
H hackhack Active Member Licensed User Longtime User Jul 25, 2011 #12 Erel said: That is correct. Click to expand... Hence my 'imprecise' Erel said: No. The user will not be able to zoom the view. Click to expand... So other apps who have pinch to zoom without buttons are using a different view, eh? Upvote 0
Erel said: That is correct. Click to expand... Hence my 'imprecise' Erel said: No. The user will not be able to zoom the view. Click to expand... So other apps who have pinch to zoom without buttons are using a different view, eh?
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2011 #13 Maybe they are handling the gestures themselves. Using the Gestures library you can handle multitouch gestures. It is not very easy, but still possible. Upvote 0
Maybe they are handling the gestures themselves. Using the Gestures library you can handle multitouch gestures. It is not very easy, but still possible.
H hackhack Active Member Licensed User Longtime User Jul 25, 2011 #14 Erel said: Maybe they are handling the gestures themselves. Using the Gestures library you can handle multitouch gestures. It is not very easy, but still possible. Click to expand... Thanks, I'll temper the ambitions a bit and wait a while on the zooming Upvote 0
Erel said: Maybe they are handling the gestures themselves. Using the Gestures library you can handle multitouch gestures. It is not very easy, but still possible. Click to expand... Thanks, I'll temper the ambitions a bit and wait a while on the zooming