I have app which is used to edit PNG file (like write text on them).
My process is create bitmap from that PNG, use Canvas to draw Text,
then use bitmap.compress to save result into SD Card.
Everything work fine. But when i check my result, i see that PPI was
changed. How to keep that PPI like the Original one.
Here is the example: my Original image has 1300x700 res and 250 ppi (i
checked with PS) but after use my app to edit that image, my result
image has 1300x700 res and 72 ppi. I want my result image still has
1300x700 res and 250 ppi
Please help me, thanks for your help.
here is my code:
- create Bitmap:
Bitmap bitmap = null;
try
{
BufferedInputStream buf = new BufferedInputStream(
PicksActivity.this.getAssets().open( file_name ) );
bitmap = BitmapFactory.decodeStream( buf );
}
catch ( Exception e )
{
// TODO: handle exception
}
- Then create bitmap overlay:
Bitmap bmOverlay = Bitmap.createBitmap( bitmap.getWidth(),
bitmap.getHeight(), Config.ARGB_8888 );
- Then compress it:
bmOverlay.compress( CompressFormat.PNG, 100, fos );
//bitmap.compress( CompressFormat.PNG, 100, fos );
I try to compress bitmap but still have that problem, so i think it is
because of create bitmap code. Im so confused now.
--
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