0

I would like to use a drawable I loaded from a resource to use as a resource again. I went that way because I needed to set the bounds of that drawable.

Drawable smiley = d.Resources.GetDrawable(Resource.Drawable.emoji_1f600);
smiley.SetBounds(0, 0, orig.LineHeight, orig.LineHeight);

//Can't pass smiley like this, an int is expected.
var imageSpan = new ImageSpan(_activity, smiley);
Saphire
  • 1,812
  • 1
  • 18
  • 34

1 Answers1

1

You can use your drawable as a bitmap, as constructor ImageSpan(Context,Bitmap) exists:

How to convert a Drawable to a Bitmap?

Community
  • 1
  • 1
Mikhail Krutov
  • 670
  • 1
  • 5
  • 29