Sounds like you will want this function in *android.graphics.Bitmap*: public boolean *compress* (Bitmap.CompressFormat format, int quality, OutputStream stream) Added in API level 1 Write a compressed version of the bitmap to the specified outputstream. If this returns true, the bitmap can be reconstructed by passing a corresponding inputstream to BitmapFactory.decodeStream(). Note: not all Formats support all bitmap configs directly, so it is possible that the returned bitmap from BitmapFactory could be in a different bitdepth, and/or may have lost per-pixel alpha (e.g. JPEG only supports opaque pixels). Parameters format The format of the compressed image quality Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the quality setting stream The outputstream to write the compressed data. Returns true if successfully compressed to the specified stream.
On Monday, November 5, 2012 5:55:54 AM UTC-6, Learner wrote: > > Hi ,, > > > Can anyone help me out for encryption and decryption of images in Android > , if any sample provide that would be great.. > > > Thanks in Advance > > > > On Wed, Apr 25, 2012 at 8:50 AM, kunlamp <[email protected] > <javascript:>>wrote: > >> hi did you get a encrypt jpeg/png file? I want do a sample about it ,but >> i have such a test image. >> thanks. >> >> >> On Monday, April 2, 2012 11:15:01 PM UTC+8, animesh kumar bhadra wrote: >>> >>> Hi All, >>> >>> I wanted to make a simple DRM application just to learn how Android DRM >>> works. >>> >>> My idea is, >>> 1) Encrypt on simple Jpeg/PNG image. >>> 2) Try to open that image from an android application, it should >>> throw and error to enter some validation key. >>> 3) When i enter the validation key, the PNG Image should be >>> displayed. >>> >>> Can any one guide me to any tutorials, which can help me to accomplish >>> this, also how can i encrypt the PNG/JEPG image to test my DRM code. >>> >>> Thanks in advance, i already did a Google search on the group, but could >>> not find the sample code or any example for this. >>> >>> -- >>> Regards, >>> Animesh K. Bhadra >>> >>> -- >> 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]<javascript:> >> To unsubscribe from this group, send email to >> [email protected] <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > -- 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

