- Home
- Forum
- Windows Phone
- Draw chart on WriteableBitmap with background agent
Draw chart on WriteableBitmap with background agent
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
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
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
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
- 3 Replies
- 3 Participants
-
PE Peni
- Jun 29, 2014 04:55 PM UTC
- Jul 3, 2014 10:22 AM UTC