Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
rrr_04
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Panorama image draw

Hello all,

 

I need to draw an image in panorama like Google earth.

 

I did searching over forum but did not find any reference.

 

Any idea , reference , code sample greatly appreciated.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Panorama image draw

What is 'panorama mode?

 

Point 0,0 is always the top left hand corner and you always paint with respect to that.  If you want to paint the other way, then you will have to rotate.

 

For example, if you have a bitmap image and the top is blue and the bottom is red, when you paint this on the screen, it will always have a blue top.  If you want the left to be blue, then you have to rotate the image, and then paint it.  You can't tell the screen to paint sideways. 

Please use plain text.
Trusted Contributor
rrr_04
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: Panorama image draw

[ Edited ]

Thanks for you reply..

 

I am not sure what you suggested here as I am not much good in graphics and image processing. So can you please explain in detail. My  requirement  is like  http://www.360cities.net/prague-18-gigapixels

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Panorama image draw

Please use plain text.
Trusted Contributor
rrr_04
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: Panorama image draw

Thanks I will try and let you know what is result...
Please use plain text.
Trusted Contributor
rrr_04
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: Panorama image draw

[ Edited ]

Hello ,

 

I tried as per link given by you but its just scrolling the image in field. :smileysad: 

 

any other reference or can you please suggest how can I make panorama scrolling view using scrollable image field. Or any reference from opengl.

 

 

 

 

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Panorama image draw

[ Edited ]

Sorry I don't know OpenGL.

 

The thing with the sample I sent you is that it chooses which part of the Image it has to be displayed, based on the current location.  So as you say, if you have one image then you are bounded by the edges of that.

 

So you need to extend this I believe to support the panorama type display.  I suspect you will do the following:

 

a) 'join' the edges of the bitmap, so that it looks like the edges of the Bitmap are joined together.  So if you are at the right hand edge and he user scrolls right, instead of stopping, you display some of the right hand edge of the image and then do another 'paint' to display the left hand edge next to it.

 

b) I think a panorama like the one you pointed at is actually multiple images bolted together, so you will extend this to display the right hand edge of the current image, followed by the left hand edge of the image that is logically next to it.  You are basically tiling this yourself, much like the maps applications do. 

 

c) You will have to do the same for 'up' and 'down'

 

d) Finally you may wish to implement zoom in and out.  I think you will have to do this with multiple images (so you have multiple panorama at different zoom levels) because I doubt that the Blackberry will cope with a single very large image that you zoom with - this is how Google earth seems to work if you want an example from elsewhere.  Assuming you do need multiple 'levels', you will choose the appropriate one based on the zoom level.  However these will be big jumps.  Within these jumps you may wish to scale the images you have and you can do this on the fly in a number of ways.  I would encourage you to review this KB article.

 

http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524

 

and also the Bitmap scaleInto function, which I think works really well.

 

Basically you have to create this from scratch, there is no supplied API to do (that I am aware of), but in fact, it is not that difficult, just time consuming.  And sounds like fun.  Good luck. 

 

Edit: Spell checked, sorry about the mistakes that were there before.

Please use plain text.
Trusted Contributor
rrr_04
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: Panorama image draw

[ Edited ]

Thanks ,

 

let me try  as you suggest, and will back here .

 

Any other input from any one it will help me. I will be back here with  whatever I try and its result.

 

 

Please use plain text.
Trusted Contributor
omar123456789
Posts: 103
Registered: ‎11-07-2010
My Device: Not Specified

Re: Panorama image draw

What is the result?

 

I am excited to know it.

Please use plain text.
Trusted Contributor
omar123456789
Posts: 103
Registered: ‎11-07-2010
My Device: Not Specified

Re: Panorama image draw

Dear sir, you made apost before named anorama image draw here i need to do the same, could you please send me the source code or give me some hints on how to make panorama ? thnx,
Please use plain text.