BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-27-2007, 07:18 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2007
Location: India
Model: 8700g
Carrier: Airtel
Posts: 117
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default UI issue.

Please Login to Remove!

I want to streach the img on the entire screen.But the image does not occupy the whole screen.Can somebody tell me where i am going wrong.
Check the following code snippet:
Code:
_bitmap  = Bitmap.getBitmapResource(icon.PNG);
_bmp = new BitmapField(_bitmap, BitmapField.USE_ALL_HEIGHT | BitmapField.USE_ALL_WIDTH) {
             public void paint(Graphics g) {
                 g.drawBitmap(0, 0, g.getScreenWidth(), g.getScreenHeight(), _bitmap, 0, 0);
            }
        };
add(bmp )
__________________
Thanks
Meenal

Last edited by Meenal : 09-27-2007 at 07:23 AM.
Offline  
Old 09-27-2007, 08:07 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8800
PIN: N/A
Carrier: CLDC
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Ui Issue?

Quote:
Originally Posted by Meenal View Post
I want to streach the img on the entire screen.But the image does not occupy the whole screen.Can somebody tell me where i am going wrong.
Check the following code snippet:
Code:
_bitmap  = Bitmap.getBitmapResource(icon.PNG);
_bmp = new BitmapField(_bitmap, BitmapField.USE_ALL_HEIGHT | BitmapField.USE_ALL_WIDTH) {
             public void paint(Graphics g) {
                 g.drawBitmap(0, 0, g.getScreenWidth(), g.getScreenHeight(), _bitmap, 0, 0);
            }
        };
add(bmp )

If u want to add image then first take any manager like,

VerticalFieldManager vfm=new VerticalFieldManager(Manager.USE_ALL_HEIGHT);

then,add your bitmapfield on to the manager,

vfm.add(bmp);

and after that add this manager on to the screen...

this.add(vfm);

Definately it solves your problem....

Thanks,
-Hitesh
__________________
Regards,
Hitesh
Offline  
Old 09-27-2007, 08:28 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Posts: 150
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by dangihitesh View Post
If u want to add image then first take any manager like,

VerticalFieldManager vfm=new VerticalFieldManager(Manager.USE_ALL_HEIGHT);

then,add your bitmapfield on to the manager,

vfm.add(bmp);

and after that add this manager on to the screen...

this.add(vfm);

Definately it solves your problem....

Thanks,
-Hitesh
I think this is not the right decision. It will only put the image on the screen. If the image is smaller than the screen size it will paint the image in the left-top corner of the screen but not stretched. I don't know how you the img can be stretched. Look at the all methods for Graphics class or Bitmap ot BitmapField. Good luck!
Offline  
Old 09-27-2007, 09:40 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

this guys code snippet works fine, have used it before:

Resizing an image
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
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

Bendix Dynapath 3733556D Monitor w Latch & Memory Power Regulator S5
$1200.16
Bendix Dynapath 3733556D Monitor w Latch & Memory Power Regulator S5 pictureLot of RAM Desktop Memory Sticks PC133 PC2 PC333 128MB 256MB 512MB 1GB
$46.49
Lot of RAM Desktop Memory Sticks PC133 PC2 PC333 128MB 256MB 512MB 1GB pictureLot of 15 Allen Bradley Memory Segment, # 1772-MS, 2048 Word Ram, Used
$0.99
Lot of 15 Allen Bradley Memory Segment, # 1772-MS, 2048 Word Ram, Used pictureMitsubishi A9GT-QFNB4M, Memory Cassette 4Mbytes as photo, sn:0311.
$59.55
Mitsubishi A9GT-QFNB4M, Memory Cassette 4Mbytes as photo, sn:0311. pictureAllen Bradley 1764-MM1, MicroLogix 1500 8K Memory Module as photo.
$34.53
Allen Bradley 1764-MM1, MicroLogix 1500 8K Memory Module as photo. picture






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