I would like to enable users to copy a chart to the clipboard, preserving appearance and transparency, so I've chosen to use PNG as the format.
However, when I paste from the clipboard, all of the transparent areas are black, which is not desirable. I don't have much experience with clip board operations, so perhaps I am doing something wrong, though other than the transparency is seem so work fine. Is there a way I can accomplish this either and either preserve the chart's transparency or at least grabbing a rendering of the chart using its current background (almost always white)?
PngBitmapEncoder bitmapEncoder =
new
System.Windows.Media.Imaging.PngBitmapEncoder ();
var chartPicture = currChart.Save (96, 96, bitmapEncoder);
PngBitmapDecoder bitmapDecoder =
new
PngBitmapDecoder (chartPicture, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
Clipboard.SetImage (bitmapDecoder.Frames[0]);
However, when I paste from the clipboard, all of the transparent areas are black, which is not desirable. I don't have much experience with clip board operations, so perhaps I am doing something wrong, though other than the transparency is seem so work fine. Is there a way I can accomplish this either and either preserve the chart's transparency or at least grabbing a rendering of the chart using its current background (almost always white)?