07-17-2008 11:56 AM
Quote from the previous forums:
I want to get am image form server using HttpConnection and display in my application,
I have used following code:
//GETTING INPUTSTREAM FORM CONNECTION CLASS.
ByteArrayOutputStream os=new ByteArrayOutputStream();
//CONVERTING ByteArrayOutputStream TO BYTE ARRAY.
//CONVERTING BYTE DATA TO BITMAP.
bmap = Bitmap.createBitmapFromBytes(data,0,data.length,1 );
//DIPLAYING BITMAP USING GRAPHICS OBJECT
graphics.drawBitmap(0,imageBorderUp, screenWidth,screenHeight, bmap, 0, 0);
But i am only getting an error "IllegalArgumentException". I have extends FullScreen in my application. As i am getting the image from server, I am unable to add the image to the project in the IDE. Pls help me to solve this problem.
Any help is appreciated.
07-18-2008 02:39 PM
Quote from the previous forum:
Thanx a lot that really helped me .Now i am getting image in form of bytes. But problem i am getting now to draw the image. Could you please help me on that?
07-19-2008 11:55 AM
Probably off-topic but it may help some people. If you just want to display the image to the user, you can create a dynamic link in the web server and pass just the web link to the BlackBerry applicaton. Then you ask the BlackBerry browser to download the image. The nice thing about this option is that it will automatically reduce the size of the image for you. Plus the BlackBerry browser has a lot of functionalities related to image that you may use.
Sorry if this is off-topic. Just wanted to present different perspectives to download image .