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
New Developer
roses_r
Posts: 86
Registered: ‎01-20-2012
My Device: Bold Touch

How to set a bitmap field to go on full screen with a click event?

Hi guys,

 

I have a bitmapfield with a few buttons on my application. is there a possibility of  setting the bitmap field to go on fullscreen with a double click event or something like that?

 

as in when i click on the bitmapfield it should go on full screen

 

Thanks

Please use plain text.
Developer
madiha
Posts: 107
Registered: ‎05-26-2011
My Device: Torch

Re: How to set a bitmap field to go on full screen with a click event?

add that bitmap field in a custom manager and draw that bitmap in managr'spaint method .

 

like

public class CustomManager extends Manager implements
		FieldChangeListener {

	Bitmap _bitmap;
	
	CustomManager (Bitmpa bitmap){
		_bitmap = bitmap;
	}
	

	protected void paint(Graphics graphics) {
		super.paint(graphics);
	
		graphics.drawBitmap(0, 0, _bitmap.getWidth(),
				_bitmap.getHeight(),_bitmap, 0, 0);

}
public Bitmap get_bitmap() {
        return _bitmap;
    }
    public void set_bitmap(Bitmap bitmap) {
        _bitmap = bitmap;
    }
}

 

there is not double click in BB api , you wil have to code navigationclick method of button field and check if  it has got a double click on it, set a flag , for single click do nothing and for double click set that flag and then  change yor custom mgr's bitmap you want and mark  the manager as invalidate.

 

Please use plain text.
New Developer
roses_r
Posts: 86
Registered: ‎01-20-2012
My Device: Bold Touch

Re: How to set a bitmap field to go on full screen with a click event?

Thanks will try this. But I need to put the existing bitmap field on full screen not a new one. will that be possible?

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

Re: How to set a bitmap field to go on full screen with a click event?

I am not sure I understand that question.

 

A Bitmap is an image that has a specific size.  The Screen is a specific size as well, though it changes from device to device.  So I think you are asking about scaling the same Bitmap.  If so, look here:

http://supportforums.blackberry.com/t5/Java-Development/Cropping-Stretching-to-Screen-Resollution/td...

 

Note that enlarging a Bitmap typically causes some image problems like noise on the image.  So an emlarged image might not look good full screen. 

 

If this is a problem, then you should package the full size in your app (or download the full size) and then scale it down for use on the screen when not full size. 

Please use plain text.