BitmapFactory.decodeByteArray problem

Put your problem here if it does not fit any of the other categories.

BitmapFactory.decodeByteArray problem

Postby arunjith » Thu Jan 17, 2008 10:47 am

Hi all,

I have a raw rgb file with me , where each frame data is (240 * 200 * 2) (width * height * each pixel has 2 byte ).
I am reading this much data each time and passing to BitmapFactory.decodeByteArray

I am using the following function in BitmapFactory static class to decode the buffer into bitmap
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. decodeByteArray(byte[] imageData, int offset, int length, int preferredWidth, int preferredHeight)
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

usage is as follows
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. image = BitmapFactory.decodeByteArray(readBuffer,0,240*200*2 ,240,200);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


but what the function returns is a null image

can anyone guide me where I'm facing the problem
arunjith
Freshman
Freshman
 
Posts: 7
Joined: Fri Jan 11, 2008 12:53 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 23 guests