Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
07-14-2012 12:47 AM - edited 07-14-2012 12:49 AM
Ok, so my goal is to :
1. Read some bytes from a httpconnection where the url is located
2. Use that information to construct an empty bitmap with the width and height
3. Read all the bytes from httpconnection and populate the empty bitmap with that information
The question I have is that let's say the external image I'm reading from is a png. What function of the Bitmap class can I use to populate the empty bitmap with the full byte array that I read? Will setRGB565 work in this case? Or is it just not possible?
07-14-2012 04:04 PM
I just re-read your message and saw that I understood something else completely...
Anyway, can you please give some more details on your requirements?
In particular, why do you need to create an empty bitmap and only after to populate it...
07-14-2012 11:02 PM - edited 07-14-2012 11:04 PM
1.Create empty bitmap with dimensions of not completely downloaded image
2. Add bitmap to UI
3. Add data to bitmap
Using this technique I can reduce layout interruptions/lag caused by having to scale the image to the correct size. I can then then just call invalidate instead of updateLayout.
07-14-2012 11:18 PM
I've attached a class that does the first part. You will need to modify it to store all the read bytes into the bytearrayoutputstream for every function. I only did it for the png file. You must use those bytes and append to the beginning of the rest of the stream you read in for the stream to be read correctly.