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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Saving chart to file from chart.GetAsStream ()

Thread ID:

Created:

Updated:

Platform:

Replies:

141650 Dec 24,2018 05:16 PM UTC Dec 26,2018 12:43 PM UTC Xamarin.Android 2
loading
Tags: SfChart
Ilya
Asked On December 24, 2018 05:16 PM UTC

Hello,

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 ?

Sincerely
Ilya

Ilya
Replied On 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);

Michael Prabhu M [Syncfusion]
Replied On 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. 
 
Thanks, 
Michael 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;