Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 753887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:56:55+00:00 2026-05-14T14:56:55+00:00

I use the following code to retrieve image from the phone or SDCard and

  • 0

I use the following code to retrieve image from the phone or SDCard and I use that image in to my ListField. It gives the output but it takes very Long time to produce the screen. How to solve this problem ?? Can any one help me?? Thanks in advance!!!

String text = fileholder.getFileName();
try{
 String path="file:///"+fileholder.getPath()+text;
 //path=”file:///SDCard/BlackBerry/pictures/image.bmp”

 InputStream inputStream = null;
 //Get File Connection
 FileConnection fileConnection = (FileConnection) Connector.open(path);

 inputStream = fileConnection.openInputStream();

 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 int j = 0;
 while((j=inputStream.read()) != -1) {
 baos.write(j);
 }
 byte data[] = baos.toByteArray();                
 inputStream.close();
 fileConnection.close();  

 //Encode and Resize image 
 EncodedImage  eImage = EncodedImage.createEncodedImage(data,0,data.length);
 int scaleFactorX = Fixed32.div(Fixed32.toFP(eImage.getWidth()), 
      Fixed32.toFP(180));
 int scaleFactorY = Fixed32.div(Fixed32.toFP(eImage.getHeight()), 
      Fixed32.toFP(180));
 eImage=eImage.scaleImage32(scaleFactorX, scaleFactorY);
 Bitmap bitmapImage = eImage.getBitmap();  
 graphics.drawBitmap(0, y+1, 40, 40,bitmapImage, 0, 0);
 graphics.drawText(text, 25, y,0,width);
}
catch(Exception e){}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:56:56+00:00Added an answer on May 14, 2026 at 2:56 pm

    You should read files once (on App start or before screen open, maybe put a progress dialog there), put images in array and use this array in paint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently use the following code to retrieve and decompress string data from Amazon
I use the following code to retrieve the login credentials from the iPhone keychain:
I use the following code for retrieve the data from my Sql DB.retrieve StudName
I am trying to use the following code to retrieve data from a custom
I use the following code to retrieve the data from MySql database. GContnStr is
I use the following code to set the retrieve the phone number in my
I use the following code for retrieve the data from mysql Student data Base.It
Currently I use the following code to retrieve the IP address of the local
I just use following code to add an image to my project, var paper
I use the following code to crop an image according to a rectangular selection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.