BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-09-2011, 08:10 AM   #1 (permalink)
New Member
 
Join Date: Mar 2011
Model: 9700
PIN: N/A
Carrier: developer
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add dynamically image in Bitmap Field

Please Login to Remove!

Hi

I try to add dynamically Bitmap field but its not working plz help me .

My Code is

Code:
try
		{
			
			 fc = (FileConnection)Connector.open(FILE_NAME, Connector.READ);
			 
			rootEnum = fc.list();
					
             while (rootEnum.hasMoreElements()) 
             {
                file = (String)rootEnum.nextElement();
                imgName=file.substring(0, file.length()-4);
                 DataContext dc=new DataContext();
    			 byte[] data=(byte[])dc.get(imgName.trim());
    			
    			 EncodedImage  eImage = EncodedImage.createEncodedImage(data,0,data.length);
    			
    			 int scaleFactorX = Fixed32.div(Fixed32.toFP(eImage.getWidth()), 
    			      Fixed32.toFP(60));
    			 int scaleFactorY = Fixed32.div(Fixed32.toFP(eImage.getHeight()), 
    			      Fixed32.toFP(60));
    			 eImage=eImage.scaleImage32(scaleFactorX, scaleFactorY);
    			 
    			 bm_img[i] =(Bitmap) eImage.getBitmap(); 
    			
    			 row.add(new BitmapField(bm_img[i]));
    			 row.add(new LabelField(imgName, DrawStyle.ELLIPSIS));
    			 rows.addElement(row);
    			 i++;
             }
		}catch(Exception e)
		{
			System.out.print(e);
		}
Offline  
Old 03-09-2011, 08:31 AM   #2 (permalink)
Spam Reporter
 
dc/dc's Avatar
 
Join Date: Oct 2005
Location: IAD
Model: 6230
Carrier: Voicestream
Posts: 14,524
Post Thanks: 214
Thanked 341 Times in 307 Posts
Default Re: How to add dynamically image in Bitmap Field

You need to check the Developer section.
__________________
I h8 txtspk.
Offline  
Old 03-09-2011, 07:26 PM   #3 (permalink)
Latino Hasta La Muerte
 
rambo47's Avatar
 
Join Date: Jan 2005
Location: Denville, NJ.
Model: Fruit
Carrier: Verizon
Posts: 9,058
Post Thanks: 52
Thanked 307 Times in 292 Posts
Default Re: How to add dynamically image in Bitmap Field

Carrier: "developer".


Mods: we desperately need a "roll eyes" emoticon.
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

Similar Threads for: How to add dynamically image in Bitmap Field
Thread Thread Starter Forum Replies Last Post
How to add Image in TextField manickam Developer Forum 0 06-30-2009 12:38 AM
Sync Error....What could it be? kurrupt_1 General 8300 Series Discussion - Curve 7 11-22-2007 07:41 PM
zoom in the text on the image streamh Developer Forum 3 09-19-2007 01:09 AM
8703e guide techman1 BlackBerry Guides 3 09-28-2006 09:24 AM
8703e guide and all other series of bb techman1 BlackBerry Guides 1 09-21-2006 09:12 PM

Banner Photoelectric Amplifier Logic Module B8A B8A New
$59.99
Banner Photoelectric Amplifier Logic Module B8A B8A New pictureNEW OPEN BOX - Valcom V-1020C Self-Amplified 8" Flush Mount Ceiling Speaker
$24.99
NEW OPEN BOX - Valcom V-1020C Self-Amplified 8Stober Drives FDS4014/B PosiDrive FDS4000
$350.0
Stober Drives FDS4014/B PosiDrive FDS4000 pictureNEW KEYENCE FIBER OPTIC AMPLIFIER 12-24 VDC MODEL FS-17P
$75.0
NEW KEYENCE FIBER OPTIC AMPLIFIER 12-24 VDC MODEL FS-17P pictureBanner B5R Logic Module Plug In Photoelectric Amplifier Dark & Light Operate
$50.0
Banner B5R Logic Module Plug In Photoelectric Amplifier Dark & Light Operate picture






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