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: 9370
Carrier: Verizon
Posts: 9,060
Post Thanks: 52
Thanked 309 Times in 294 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

Measurement Computing PCI-DAS1602/16 Analog and Digital I/O Board
$349.99
Measurement Computing PCI-DAS1602/16 Analog and Digital I/O Board pictureExtron RGB192 (VGA) 60-486-01 Analog Computer-Video Interface *NEW In Open Box*
$49.99
Extron RGB192 (VGA) 60-486-01 Analog Computer-Video Interface *NEW In Open Box* pictureComputer Boards, INC. CIO-DAS48-PGA // 94-3435 Rev.A Analog Input Board
$279.9
Computer Boards, INC. CIO-DAS48-PGA // 94-3435 Rev.A Analog Input Board pictureExtron RGB192 (VGA) 60-486-01 Analog Computer-Video Interface **NEW In Box**
$110.0
Extron RGB192 (VGA) 60-486-01 Analog Computer-Video Interface **NEW In Box** pictureCIO-DAS08 Analog Input Board Computer Boards
$54.99
CIO-DAS08 Analog Input Board Computer Boards picture






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