0

I have an EditText which contains smiley faces, the smiley faces are being added to the EditText as a spanable content,

I managed to draw the other things like "underline", "bold" and "italic", but I'm having trouble in drawing the bitmaps. Since when converting the EditText content to a string, the bitmaps are replaced with unicode object character "fffc" http://www.fileformat.info/info/unicode/char/fffc/index.htm

Any help is appreciated

Kara
  • 6,115
  • 16
  • 50
  • 57
Ali Alnoaimi
  • 2,278
  • 2
  • 21
  • 31

1 Answers1

1

wouldn't it be easier to let the edit text draw itself into a bitmap and draw that bitmap onto your canvas?

    Canvas c = new Canvas(bitmap); 
    edit.draw(c);

Otherwise you need to get the ImageSpans and use ImageSpan.getDrawable() to draw the smileys:

    ImageSpan[] images = s.getSpans(0, s.length(),ImageSpan.class);
Renard
  • 6,909
  • 2
  • 27
  • 23