4 Answers, 1 is accepted
0
Hello Thanaphon,
Thank you for your interest.
I assume that by "share chart" you mean RadPieChart. You can check the sample setup of RadPieChart in our online documentation here - http://www.telerik.com/help/windows-8-xaml/radchart-series-pieseries.html.
I hope this is useful. Let me know if you need further assistance.
Ivaylo Gergov
the Telerik team
Thank you for your interest.
I assume that by "share chart" you mean RadPieChart. You can check the sample setup of RadPieChart in our online documentation here - http://www.telerik.com/help/windows-8-xaml/radchart-series-pieseries.html.
I hope this is useful. Let me know if you need further assistance.
Greetings,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Thanaphon
Top achievements
Rank 1
answered on 06 Mar 2013, 03:00 AM
Yes, my mean is RadPieChart. but I am want to share my chart to my friend by email or facebook as windows 8 feature.
0
Hi Thanaphon,
This functionality is related entirely with the WinRT platform so you can check in the MSDN library how they suggest to handle such situations - http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh871373(v=win.10).aspx.
Note, that at this point the platform does not provide any means to take a picture of already existing visual element in XAML.
I hope this information is useful.
Ivaylo Gergov
the Telerik team
This functionality is related entirely with the WinRT platform so you can check in the MSDN library how they suggest to handle such situations - http://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh871373(v=win.10).aspx.
Note, that at this point the platform does not provide any means to take a picture of already existing visual element in XAML.
I hope this information is useful.
Kind regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Abdu
Top achievements
Rank 1
answered on 05 Jun 2014, 11:13 AM
Hi,
We can share the chart via screen shot, in windows 8.1
Here is the code, enjoy!
async void dataTransferMgr_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "Title";
request.Data.Properties.Description = "brief description";
request.Data.SetText("detailed information");
RandomAccessStreamReference imageStreamRef = await ScreenshotToStreamReferenceAsync(yourChartControlName);
request.Data.Properties.Thumbnail = imageStreamRef;
request.Data.SetBitmap(imageStreamRef);
}
private async Task ScreenshotToStreamAsync(FrameworkElement element, IRandomAccessStream stream)
{
var renderTargetBitmap = new Windows.UI.Xaml.Media.Imaging.RenderTargetBitmap();
await renderTargetBitmap.RenderAsync(element);
var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
var dpi = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream);
encoder.SetPixelData(
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Ignore,
(uint)renderTargetBitmap.PixelWidth,
(uint)renderTargetBitmap.PixelHeight,
dpi,
dpi,
pixelBuffer.ToArray());
await encoder.FlushAsync();
}
private async Task<RandomAccessStreamReference> ScreenshotToStreamReferenceAsync(FrameworkElement element)
{
var ms = new InMemoryRandomAccessStream();
await ScreenshotToStreamAsync(element, ms);
ms.Seek(0);
return RandomAccessStreamReference.CreateFromStream(ms);
}
We can share the chart via screen shot, in windows 8.1
Here is the code, enjoy!
async void dataTransferMgr_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
DataRequest request = args.Request;
request.Data.Properties.Title = "Title";
request.Data.Properties.Description = "brief description";
request.Data.SetText("detailed information");
RandomAccessStreamReference imageStreamRef = await ScreenshotToStreamReferenceAsync(yourChartControlName);
request.Data.Properties.Thumbnail = imageStreamRef;
request.Data.SetBitmap(imageStreamRef);
}
private async Task ScreenshotToStreamAsync(FrameworkElement element, IRandomAccessStream stream)
{
var renderTargetBitmap = new Windows.UI.Xaml.Media.Imaging.RenderTargetBitmap();
await renderTargetBitmap.RenderAsync(element);
var pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
var dpi = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().LogicalDpi;
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream);
encoder.SetPixelData(
BitmapPixelFormat.Bgra8,
BitmapAlphaMode.Ignore,
(uint)renderTargetBitmap.PixelWidth,
(uint)renderTargetBitmap.PixelHeight,
dpi,
dpi,
pixelBuffer.ToArray());
await encoder.FlushAsync();
}
private async Task<RandomAccessStreamReference> ScreenshotToStreamReferenceAsync(FrameworkElement element)
{
var ms = new InMemoryRandomAccessStream();
await ScreenshotToStreamAsync(element, ms);
ms.Seek(0);
return RandomAccessStreamReference.CreateFromStream(ms);
}