I am working with an image. In my application I have displayed an image from drawable and set that drawable image to ImageView. When I click on a button I would like to encode the ImageView image to byte code by using Base64.
I have implemented code as follows:
((ImageView)findViewById(R.id.imageView1)).setImageResource(R.drawable.person);
((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
((TextView)findViewById(R.id.textView1)).setText("Get((ImageView)findViewById(R.id.imageView1)) image Base64.encode() here");
}
});
How can I get the encoded imageView1 image to byte code?
Can anybody please help me.
Try this…
Now set that string to your Textview as