View Single Post
Old 01-28-2010, 11:41 PM   #1 (permalink)
pinotiamo
New Member
 
Join Date: Aug 2009
Model: 8800
PIN: N/A
Carrier: BB
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Problem with HttpConnection read png image (server 64bit)

Please Login to Remove!

Code:
                   String url = "star.png" 
                   // place server 64bit, star.png(128,128)
                   HttpConnection str = (HttpConnection) Connector.open(url);
                   byte[] baResult = null;
                   input = str.openInputStream();
                   DataBuffer db = new DataBuffer();
                   int len = 0;
                   byte[] baChunk = new byte[1024];
                   int size = 0;
                   while ( -1 != (len = input.read(baChunk)) )
                   {
                        db.write(baChunk, 0, len);
                        size += len;
                  }
                  baResult = db.toArray();
                  mapimages = Bitmap.createBitmapFromBytes(baResult,0,size,1);
....

public void paint(Graphics g)
{
    g.drawBitmap(0,0,128,128,mapimages,0,0);
}
I test on simulator + MDS is OK
but on real device image is not display

When I place star.png file on server 32 bit is OK, image is display.

please help me?
Offline   Reply With Quote