did u try TITLE On 3/27/09, rens...@gmail.com <rens...@gmail.com> wrote: > > Can any one help on this? > > On Mar 26, 6:20 pm, Ren <rens...@gmail.com> wrote: >> I have the following code to save a bitmap to a jpg file. It works except >> I >> couldn't specify the file name. >> >> The image file is save in /sdcard/dcim/Camera. How do I specify a file >> name, >> or even the saved path? >> >> Cheers >> >> ContentValues values = new ContentValues(); >> values.put(MediaStore.Images.ImageColumns.DISPLAY_ NAME, "newpic"); >> values.put(MediaStore.Images.ImageColumns.MIME_TYP E, "image/jpeg"); >> Uri uri = getContentResolver().insert(MediaStore.Images.Medi >> a.EXTERNAL_CONTENT_URI, values); >> >> try{ >> OutputStream out = getContentResolver().openOutputStream(uri); >> bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);}catch(IOException >> e){ >> >> Log.e("save image", "failed to save image", e); >> >> } >> >> -- >> Kind Regards, >> Ren > > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---