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.

Draw chart on WriteableBitmap with background agent

Thread ID:

Created:

Updated:

Platform:

Replies:

116910 Jun 29,2014 12:55 PM Jul 3,2014 06:22 AM Windows Phone 3
loading
Tags: Chart
Peni
Asked On June 29, 2014 12:55 PM

Hi,

I want to create a live tile with a line graph on it, so my App has a background agent to draw UserControl with SfChart on a WriteableBitmap, and then show the image on live tile.

Code Example:
MyChartUserControl uc = new MyChartUserControl();
WriteableBitmap wbmp = new WriteableBitmap(691, 336);
wbmp.Render(uc, null);
wbmp.Invalidate();

using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
            {
                using (IsolatedStorageFileStream imageStream = new IsolatedStorageFileStream(TILE_IMAGE_PATH, System.IO.FileMode.Create, isf))
                {
                    wbmp.SaveJpeg(imageStream, wbmp.PixelWidth, wbmp.PixelHeight, 0, 100);
                }
            }
// Update tile image
// .......

However, if draw line chart on WriteableBitmap with background agent, the line disappears (Please refer to the attached). And if add line chart to PhoneApplicationPage of my App, it draws correctly.

May I know how to draw a line chart on WriteableBitmap with background agent?
Thanks.

Attachment: tile01_42dd639e.zip

Mohammed Azarudeen [Syncfusion]
Replied On June 30, 2014 08:52 AM

Hi Peni,

We have analyzed the reported issue and we are unable to reproduce the issue. Can you please check with the sample in the following location? If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you.

Please let us know if you have any queries.

Thanks,

Mohammed Azarudeen.


Attachment: WritableBitmapDemo_aa65347f.zip

Peni
Replied On June 30, 2014 01:19 PM

Hi,

I had updated the sample code.

Main changes:
1. There is a scheduled task to draw chart from background agent, not foreground application.
2. ChartUserControl is in class library project, not application project.

The result image is img2.jpg.


Thank you.

Attachment: WritableBitmapDemo_5201b174.zip

Sheik Syed Abthaheer M [Syncfusion]
Replied On July 3, 2014 06:22 AM

Hi Peni,

 

Thanks for your update.

 

We have analyzed the reported issue and we could not find the issue in our control. We suspect that, the issue may be framework issue.   The Item source does not bind while bitmap renders the new instance of User Control.  We have modified your code with Microsoft control and able to reproduce the issue with Microsoft control. Please find the sample in the below location.

Please let us know if you require further assistance on this.

 

Regards,

M. Sheik


Attachment: WritableBitmapDemo_50cd7faf.zip

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.

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.

;