We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Saving chart to file from chart.GetAsStream ()


i am working on sharing chart image in Xamarin.Forms
everything good if i use SaveAsImage and then share this file. But i don't like it is saving to /pictures and trying to
save it in different directory 
i was trying to use BitmapFactory.DecodeStream (chart.GetAsStream()) ,but bitmapfactory returns null
may somebody give me a hint, how can i save image from this stream ?


2 Replies

IL Ilya December 24, 2018 06:08 PM UTC

solved.  with seek to begin

var stream = chart.GetStream();
stream.Seek(0, System.IO.SeekOrigin.Begin);
Bitmap bmp = BitmapFactory.DecodeStream(stream);

MP Michael Prabhu M Syncfusion Team December 26, 2018 12:43 PM UTC

Hi Ilya, 
Greetings from Syncfusion. We are glad you have solved this and the method you used is the efficient way to use. Let us know if you need any other assistance from us. 

Live Chat Icon For mobile
Up arrow icon