It seems that the compile time error appears because your are using the System.Windows.Forms.Clipboard.SetImage() method, which expects an object of type System.Drawing.Image. However, the bitmapDecoder.Frames element is of type System.Windows.Media.Imaging.BitmapSource and it cannot be passed to the method.
The example given by Yavor uses the WPF's Clipboard class which is located in the System.Windows namespace.
In order to copy the chart as an image in the clipboard you can try the following approaches:
- Create a System.Drawing.Image object from the stream returned by the chart's Save() method and then pass it to the WinForms' Clipboard.SetImage() method.
var img = System.Drawing.Image.FromStream(chartPicture);
- Use the System.Windows.Cliboard.SetImage() method instead of the WinForms clipboard.
There is also an approach that you can use to save the image (along its transparency) as a stream. Basically you can get the stream with the image and use the System.Windows.Cliboard.SetDataObject() method. If the application that gets the stream from the clipboard implement a logic for reading images saved in this manner (as Word for example), the picture will be pasted correctly. Here is an example in code:
(var stream =
var data =
I hope this works for you.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.