Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
how to compress an image in android
Suzzane Pinto
Ranch Hand
Posts: 214
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi,
i want to compress an image and insert into database.
which compression technique should i use without loosing quality of my image....
Pondurai Singh
Ranch Hand
Posts: 35
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
compress an image and save the image
BitmapFactory.Option imageOpts = new BitmapFactory.Options (); imageOpts.inSampleSize = 2; // for 1/2 the image to be loaded Bitmap thumb = Bitmap.createScaledBitmap (BitmapFactory.decodeFile(photoPath, imageOpts), 96, 96, false);
For your reference
http://developer.android.com/reference/android/graphics/Bitmap.html#createScaledBitmap%28android.graphics.Bitmap,%20int,%20int,%20boolean%29
Software Developer, Oracle
Java Certification
Training Labs at EPractize Labs.
Tim Moores
Saloon Keeper
Posts: 7585
176
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Lossless compression generally results in at most a 50% reduction in size - hardly worthwhile given the cost of hard disk storage these days.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
I want to compress png image(loose-less compression)
Image IO problem
Google snappy compression
How to compress a image toke from Screen (code avaiable)
Part 2 -Upload restrictions and creating the .jar file
More...