Guest User

Untitled

a guest
Apr 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. imgChild.buildDrawingCache();
  2. Bitmap bmap = imgChild.getDrawingCache();
  3. ByteArrayOutputStream stream = new ByteArrayOutputStream();
  4. bmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
  5. byte[] byteFormat = stream.toByteArray();
  6. String imgString = Base64.encodeToString(byteFormat, Base64.NO_WRAP);
  7.  
  8. <img src="data:image/png;base64,iVBORw0KGgoAAA....." />
Add Comment
Please, Sign In to add comment