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,530
Post Thanks: 220
Thanked 345 Times in 311 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
 
Join Date: Jan 2005
Location: Denville, NJ.
Model: 7250
OS: 4.1
PIN: G!!!
Carrier: Verizon
Posts: 9,045
Post Thanks: 52
Thanked 305 Times in 293 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 01: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 02:09 AM
8703e guide techman1 BlackBerry Guides 3 09-28-2006 10:24 AM
8703e guide and all other series of bb techman1 BlackBerry Guides 1 09-21-2006 10:12 PM





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