I am
1) taking a picture and
2) then draw another Bitmap on top of it
3) then I store it
I am doing it as follows and it works on the emulator.
On the device I get a OutOfMemoryError: bitmap size exceeds VM budget
android.graphics.Bitmap.nativeCopy(Native Method)
android.graphics.Bitmap.copy(Bitmap.java:199)
in the line copy the Bitmap to get a mutable Bitmap.
private void captureImage() {
Camera.PictureCallback pcbJpeg = new Camera.PictureCallback() {
public void onPictureTaken(byte[] data, Camera c) {
// Save Picture
Log.v(LOG_TAG, "PictureCallback: data.length="
+ data.length);
Bitmap photo =
BitmapFactory.decodeByteArray(data, 0,
data.length);
Bitmap mutablePhoto =
photo.copy(Bitmap.Config.RGB_565, true);
photo.recycle();
Canvas n = new Canvas(mutablePhoto);
n.drawBitmap(myPointOfInterestView.b, 0, 0,
null);
String url =
Images.Media.insertImage(getContentResolver(),
mutablePhoto,
"title", null);
mutablePhoto.recycle();
Log.i(LOG_TAG, url);
}
};
What I am asking:
a) Is there a better way to do what I am doing?
1) take a picture
2) draw another Bitmap on top of it
3) then I store it
b) What is the best way to create a mutable Bitmap from the picture I
just took with the camera?
In my app, resolution is not an issue. If it works better for small
photos that would be fine.
Any help is appreciated,
Best regards,
Ph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---