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
Contributor
Posts: 19
Registered: ‎03-04-2011
My Device: Not Specified
Accepted Solution

drawbitmap question

I'm trying to make a custom screen like the blackberry maps application (drag and zoom) except I show my own images.  I'm able to drag the image around with drawbitmap but because of the top and left parameters I can only go two ways, ie if the top/left parameters are negative I get an Illegal Argument Exception.

 

Is this the right way to go about this?  I thought about making the bitmap I'm showing larger, but it seems like that isn't a great way of doing it because if they zoom out just a little too far or drag the image too far then I'll throw an exception.

Developer
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: drawbitmap question

Even the MapField is implemented this way, requiring you to check that you don't go outside its bounding limits for zoom and pan or it throws an Exception. You're probably just going to have to continue on with what you're doing, but throw checks in your methods to check that you aren't going too far.

Contributor
Posts: 19
Registered: ‎03-04-2011
My Device: Not Specified

Re: drawbitmap question

Good to know, thanks for your help