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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get path to saved sfChart image

Thread ID:

Created:

Updated:

Platform:

Replies:

121651 Jan 13,2016 03:00 PM UTC Jan 26,2016 08:04 AM UTC Xamarin.Forms 6
loading
Tags: SfChart
David Conlisk
Asked On January 13, 2016 03:00 PM UTC

Hi all,

Loving sfChart so far!

I am using sfChart.SaveAsImage to save my chart as an image on the device. This works perfectly so far on Android - the image is saved to the device, and I can see it on the device at 

> root > sdcard > Pictures

Now I'd like to send an email with this image as an attachment. How do I find the path to the saved image?

I've tried var folder = Environment.GetFolderPath(Environment.SpecialFolder.X); where X is CommonDocuments, LocalApplicationData, Personal, CommonPictures, etc, but I haven't managed to find the correct one. Am I going about this the right way? What is the correct way to do this that will work on all Android devices?

Thanks,

David

Magesh Kumar Krishnan [Syncfusion]
Replied On January 14, 2016 12:23 PM UTC

Hi David,

Thanks for using Syncfusion products.

We have prepared a sample to get the path of saved images for Android. Please find the sample from location given below.

http://www.syncfusion.com/downloads/support/forum/121651/ze/ChartSample_GetImagePath-554251726  

Regards,
Magesh Kumar K

David Conlisk
Replied On January 14, 2016 01:06 PM UTC

Hi Magesh,

Thanks, works perfectly!

David

David Conlisk
Replied On January 22, 2016 10:04 AM UTC

Hi Magesh,

Now I have the same issue on the iOS version. It says here http://help.syncfusion.com/xamarin/sfchart/export that on iOS the image is saved in the "Photos/Album" folder, so I've been trying code like this:

var path = Environment.GetFolderPath (Environment.SpecialFolder.Personal); 
var filePath = Path.Combine (path, "Photos/Album", attachmentName);
var graphImage = UIImage.FromFile (filePath);
 

But graphImage is always null. Any ideas?

Thanks,

David

Manivannan Elangovan [Syncfusion]
Replied On January 25, 2016 11:40 AM UTC

Hi David,

We have prepared a sample for getting the saved image from the image path in iOS and it can be downloaded from the following location.

Sample: GetImagePath

Regards,
Manivannan.E

David Conlisk
Replied On January 25, 2016 01:36 PM UTC

Hi Manivannan,

Thank you. That code works. 

Ideally I would just be able to use the chart.SaveAsImage command out of the box for both platforms, rather than having to basically write my own version for iOS, but it works so thank you!

David

Manivannan Elangovan [Syncfusion]
Replied On January 26, 2016 08:04 AM UTC

Hi David,

Thanks for the update. Please let us know if you have any other queries.

Regards,
Manivannan E.

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.

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

;