Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Contributor
Pinky24
Posts: 10
Registered: 06-16-2011
My Carrier: O2

Need Help

Hello,

 

I have created one application showing my university map. I converted the pdf into image and then uploaded the image using bitmap source.

 

Now I want to fix a point in the map image to calculate the distance for the destination address.

(say at the entrace am fixing the point and want to reach the office.I need to get the distance for that).

 

Can anyone help me to know how to fix a point in the map image.???

 

Thanks.

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: Need Help

I imagine that you would obtain the Graphics context in the paint() method of the control containing the bitmap, then draw over the bitmap.

 

Having said that, I'm not so sure you are going to be able to calculate the distance between two points, unless it is using a straight line (walking through walls, etc).  Even then, you'll have to figure out how to scale pixels vs. meters (or whatever linear measurement you are using).

 

Are you sure that using a bitmap is the right way to go here?

Please use plain text.
Contributor
Pinky24
Posts: 10
Registered: 06-16-2011
My Carrier: O2

Re: Need Help

Thanks for the reply.

Am going to use the straight lines. I thought to give an imaginary xy coordinates and fix the point and then calculate the distance.

Am not sure about bitmap. I do not know any other way to import the map except using mapfield. in my case I should not use the mapfield.
Please use plain text.