skiasharp - SkBitmap.Decode(string filename) returns null

Viewed 1551

I want to decode drawable image in SKBitmap. for that I use following

var bitmap = SKBitmap.Decode("Tulips.jpg");

but I get null bitmap. because of this I have to convert it into byte[] using memory stream and it takes too much time. I tried to place full path of drawable image but no success. I also tried changing Build Action for that image.

Any help would be appreciated !!

Edit :- Thanks @Jason for commenting. Do you mean like this ??

var filestream = new SKFilestream("Tulips.jpg"); var bitmap = SKBitmap.Decode(filestream);

But it still returns null. I tried different paths also. But no success.

Can you please provide small code snippet ?? That will be very helpful. Thanks !!

0 Answers
Related