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
millec8
Posts: 19
Registered: 03-04-2011
Accepted Solution

Scrollable BitmapField

I'm new to blackberry development (as of this week) and I'm trying to create a screen that has a bitmap displayed that you can then drag/zoom and I'll go out to a webserver to get the next image and load it.  I've seen the scrollableimagefield example and its got me started but I can't drag the image down or to the right because the graphics.drawbitmap's top and left parameters are then negative. 

 

Am I going about this the right way with drawbitmap and if so is there anyway that I could just drag the bitmap down and have the screen be white like if I drag it the opposite way?

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: Scrollable BitmapField

If you set the background color and clear it

 

graphics.setbackgroundColor(Color.WHITE);

graphics.clear();

 

then only paint the portion of the Bitmap that is actually visible, at an appropriate starting position, you will create white space at the top and to the left as I think you want. 

Please use plain text.
Contributor
millec8
Posts: 19
Registered: 03-04-2011

Re: Scrollable BitmapField

I actually read up on drawBitmap a little better and figured out what was happening.  Thanks for the help though.

Please use plain text.
Developer
peter_strange
Posts: 14,614
Registered: 07-14-2008

Re: Scrollable BitmapField

Well done.

 

Can you mark this as solved?

Please use plain text.