Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Bitmap Factory

Bitmap Factory

All your problems with Audio, Video and Images.

Bitmap Factory

Postby pedroteixeira07 » Tue Jun 15, 2010 7:11 pm

Hello there,

I know we can use BitmapFactory to decodeStream from a InputStream and create a Bitmap.

I have this String with an URL for a picture on a service lets say ''www.whatever.com/image/whatever.png"

How can I retrieve this and turn it on a bitmap?

thank you for your help
pedroteixeira07
Experienced Developer
Experienced Developer
 
Posts: 74
Joined: Sun Oct 18, 2009 6:06 pm
Location: Funchal

Top

Re: Bitmap Factory

Postby Matt M » Thu Jun 17, 2010 12:29 am

I have not tried this myself but from all the searching I've been doing for my own purposes I've found this:

BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inSampleSize = 4; //A number > 1 will shrink image
URLConnection conn = (HttpURLConnection) new URL("your url for the image").openConnection();
conn.connect();
final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());
Bitmap b = BitmapFactory.decodeStream(bis, null, opt);

Matt.
User avatar
Matt M
Developer
Developer
 
Posts: 30
Joined: Tue Apr 27, 2010 7:35 pm

Re: Bitmap Factory

Postby pedroteixeira07 » Thu Jun 17, 2010 7:28 pm

Thank you very much Matt :D
pedroteixeira07
Experienced Developer
Experienced Developer
 
Posts: 74
Joined: Sun Oct 18, 2009 6:06 pm
Location: Funchal

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot], MSNbot Media and 10 guests