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
[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 - how to bitmap convert in to byte array in android

how to bitmap convert in to byte array in android

All your problems with Audio, Video and Images.

how to bitmap convert in to byte array in android

Postby narasimharao » Sat Apr 10, 2010 10:29 am

hi sir
i am new in android i am strucking some issue
i am implementing image upload in sdcard image converting bitmap in bitmap convert in bytearray i am implementing this code

import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import android.R.array;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;

public class Photo extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
File f = new File("/sdcard/DCIM/1.jpg");
FileInputStream is = null;
try {
is = new FileInputStream(f);
Bitmap bm;
bm = BitmapFactory.decodeStream(is,null,null);
ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
bm.compress(Bitmap.CompressFormat.JPEG,75, baos);
System.out.println("3........................"+bm);
ImageView pic=(ImageView)this.findViewById(R.id.picview);
pic.setImageBitmap(bm);
}
catch (Exception e)
{
// TODO: handle exception
e.printStackTrace();
}
}
}this code is i am implementing how can convert bitmap in byte array
INFO/System.out(12658): 3........................android.graphics.Bitmap@4358e3d0
in debug this will be displayed how can retrieve bitmap to byte array
narasimharao
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Apr 05, 2010 12:40 pm
Location: hyderabad

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 4 guests