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
[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 - BitmapFactory.decodeFile

BitmapFactory.decodeFile

All your problems with Audio, Video and Images.

BitmapFactory.decodeFile

Postby fala70 » Wed Dec 10, 2008 11:04 pm

I did an application that create an image file copied from external memory with follow code:
Bitmap bitmap = Media.getBitmap(getContentResolver(), uri);

ByteArrayOutputStream bytes = new ByteArrayOutputStream();
boolean besito=bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bytes);

String sPath=uri.getPath();
String sNum=sPath.substring(sPath.lastIndexOf("/")+1);
String sFileName =sNum+".jpg";
deleteFile(sFileName);
FileOutputStream fos = openFileOutput(sFileName, MODE_WORLD_WRITEABLE);
fos.write(bytes.toByteArray());
fos.close();

that code save the to internal memory area application and work. Now I 've a problem on BitmapFactory.decodeFile when I try to reload this file, BitmapFactory.decodeFile return null:

ImageView img= (ImageView) findViewById(R.id.imgThumb);
Bitmap bm = BitmapFactory.decodeFile(sFileName);
BitmapDrawable drawable = new BitmapDrawable(bitmap);
img.setImageDrawable(drawable);

somebody can help to understand why BitmapFactory.decodeFile return null ?
thanks
fala70
Freshman
Freshman
 
Posts: 3
Joined: Mon Dec 08, 2008 11:49 am

Top

Postby valibab » Wed Jan 07, 2009 3:28 pm

u have to specify total path in the methos like the one below

bitmap = BitmapFactory.decodeFile("/data/data/myPackage/files/filename");
valibab
Junior Developer
Junior Developer
 
Posts: 19
Joined: Sat Jan 03, 2009 7:11 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Google [Bot] and 7 guests