BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 01-22-2010, 04:51 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: Strom
PIN: N/A
Carrier: Vodafone
Posts: 28
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question How to click on a .jpg image in Blackberry 4.5 ?

Please Login to Remove!

Hi all,

I m displaying a .jpg image in a BitmapField & adding it in a VerticalFieldManager. It is getting displayed but I cannot click on it.

I m doing it like..

Code:
Bitmap bitmap = Bitmap.getBitmapResource("image.jpg");

BitmapField bitmapField = new BitmapField(bitmap , BitmapField.FOCUSABLE)        
    {
        protected boolean navigationClick(int status, int time )
        {
            //handle click event                
            return true;
        }
    };
VerticalFieldManager vfm = new VerticalFieldManager();
vfm.add(bitmapField);
add(vfm_stamp);
But if I take a .png image like

Code:
Bitmap bitmap = Bitmap.getBitmapResource("image.png");
then it is clickable. Why so?

Blackberry 4.5 supports .jpg image format. It displays a .jpg image then why its not clickable ? I want to make it clickable.

How to do it ?
Offline  
Old 01-22-2010, 07:45 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You want your custom BitmapField class to extend BitmapField and override isFocusable() to return true.
Offline  
Old 01-22-2010, 08:41 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: Strom
PIN: N/A
Carrier: Vodafone
Posts: 28
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question

Thanks for the reply.

By my method also it gets clicked. Only thing is that .jpg image doesnt show focus (Blue background) when pointer is moved on it.

Even I have overridden isFocusable() to return true.

How to show that focus ?
Offline  
Old 01-22-2010, 09:49 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

If you are talking about the focus highlight, then you won't see it if the JPG is not transparent or does not have a transparent border.

Try adding some margin around the bitmap - check the javadocs, I believe the method is setSpace(int,int)
Offline  
Old 01-22-2010, 11:47 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: Strom
PIN: N/A
Carrier: Vodafone
Posts: 28
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Hey,

Thanks a lot... Its working by setSpace(int,int) .
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

ThorLabs LEDD1B LED Driver T Cube W/ Power Supply
$99.99
ThorLabs LEDD1B LED Driver T Cube W/ Power Supply picture800T-B9A ALLEN BRADLEY YELLOW EXTENDED HEAD PUSH BUTTON TYPE 4,13, 1NO 1NC--SES
$50.17
800T-B9A  ALLEN BRADLEY YELLOW EXTENDED HEAD PUSH BUTTON TYPE 4,13, 1NO 1NC--SES picture1Pc Used Siemens 6SL3224-0BE22-2UA0 6SL32240BE222UA0 Tested Good
$224.0
1Pc Used Siemens 6SL3224-0BE22-2UA0 6SL32240BE222UA0 Tested Good picture1Pc Used Siemens 6SE7031-0EE20-Z 6SE70310EE20Z Tested It In Good Condition
$11198.0
1Pc Used Siemens 6SE7031-0EE20-Z 6SE70310EE20Z Tested It In Good Condition picture1Pc Used Siemens 6FC4600-1AS01 6FC46001AS01 Tested It In Good Condition
$752.0
1Pc Used Siemens 6FC4600-1AS01 6FC46001AS01 Tested It In Good Condition picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.