Open dudus2000 opened 8 years ago
Place the gif to be played in the raw folder
Stream gif = Resources.OpenRawResource(Resource.Raw.sample_gif);
we can easily get the byte array from the stream.
var stream = Resources.OpenRawResource(Resource.Drawable.sample_gif);
var bytes = ReadAllBytes(stream);
gifImageView.SetBytes(bytes);
public byte[] ReadAllBytes(Stream instream)
{
if (instream is MemoryStream)
return ((MemoryStream)instream).ToArray();
using (var memoryStream = new MemoryStream())
{
instream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
I'm new and please help - how to insert "hook" to project a gif image from a folder drawable.
I'm sorry for the confusion but I found such a solution - but it does not work in Xamarin https://github.com/felipecsl/GifImageView/issues/12