BitmapFactory decodeByteArray RGB565 format

by » Thu, 06 Aug 2009 14:27:42 GMT

Sponsored Links
 In a byte[], I am having the image data of a RGB565 image(no header,
only image content)

I used the decodeByteArray with Bitmap.Options as RGB565 decoder.

But the decoding process failed.

Am I missing anything?

Other Threads

1. Saving a picture not in the Camera folder?


I'm trying for my app to create a picture this way:

        ContentValues contentValues = new ContentValues(3);
        contentValues.put(MediaColumns.DISPLAY_NAME, name);
        contentValues.put(ImageColumns.DESCRIPTION, desc);
        contentValues.put(MediaColumns.MIME_TYPE, "image/jpeg");
        Uri uri = getContentResolver().insert
(Media.EXTERNAL_CONTENT_URI, contentValues);
        outputStream = getContentResolver().openOutputStream(uri);
        /* write to outputStream then close it */

It works fine, except when doing this, the picture is written in the
"Camera" folder (/sdcard/dcim/Camera).
Since the picture was not taken with the camera, this is not

Is there any way to put it directly in dcim?

Actually, I also tried to create my file directly (not using the
content provider, but creating manually the file in /sdcard/dcim). The
problem is doing this way, the Pictures app doesn't seem to see my
image until I reboot the phone. Maybe there's a way to notify the
Pictures app so it rescans the pictures?

Thanks a lot for your help.


2. List activity performs worse each time it is "onStop()"ed and "onRestart()"ed

I have a list activity with a custom list adapter that is constructed
around People.Contacts (just the NAME column).  I customize it by
adding an ImageView to each row, to go with the TextView that displays
the name of the contact.

As far as I can tell, this is all I do.  I also have menu options that
allow you to launch things like the view contact activity (something

Uri uri1 = Uri.withAppendedPath(People.CONTENT_URI, ""+personID1);
Intent i1 = new Intent(Intent.ACTION_VIEW, uri1);

Apparently, if I repeat this operation multiple times from my list
activity, then hit the BACK button to return to my list activity, the
load time for my list activity gets worse and worse, and eventually
triggers an ANR.  However, quitting my list activity and restarting it
(essentially going through onPause(), onStop(), then onDestroy(), and
then onStart(), onCreate(), and onResume()), will reload the list
quickly with no problems.

I believe the problem lies somewhere in the onPause(), onStop(), and
onRestart(), onStart(), onResume() sequence that happens when I launch
a new activity then return to my list activity.

Any help on why the performance would get worse and worse each time
would be appreciated.  The fact that the list can be loaded "from
scratch" in onCreate() tells me it doesn't have anything to do with
the list adapter (I've also tried destroying all references to objects/
variables in onPause(), then copy/pasting the initialization code I
use in onCreate() into onResume(), but this did not solve anything).

P.S. One last note, is that I am able to launch new an activity that
has Theme.Dialog, and basically go through the onPause()-onResume()
cycle many many times, with no performance issues.  Basically, it
seems like something about onStop() and/or onRestart() is going


3. cell id - active and passive cells

4. Grid View focus problem on changing orientation

5. Localization and number / date formatting

6. ADP 1.1 ( import contacts from SIM card crashes

7. Droid Dev Challenge 1: Cupcake Widget