如何将图像转换为二进制并显示结果Text view
?
我试过这个源代码,但我不能继续,我是新手。
protected void onActivityResult(int codeA, int resl, Intent data){
if(codeA == HASIL_LOAD_PICT && resl == RESULT_OK && null !=data){
Uri choosepict = data.getData();
String[] filepath = {MediaStore.Images.Media.DATA};
Cursor cr = getContentResolver().query(choosepict, filepath, null, null, null);
cr.moveToFirst();
int colIndex = cr.getColumnIndex(filepath[0]);
String filepathme = cr.getString(colIndex);
cr.close();
ImageView iv = (ImageView) findViewById(R.id.imgView);
iv.setImageBitmap(BitmapFactory.decodeFile(filepathme));
}
}