Jump to content
Software FX Community

Exporting chart images to the clipboard.


Choyee

Recommended Posts

Hi,

I've been working on implementing toolbar items for WPF charts as in ChartFX 7.

I manged to export chart images as one of image file formats, but I couldn't find a way to exporting them to the clipboard.

If I could find the properties related to the currently displayed chart image, I thought I might use the ApplicationCommands.Copy.Execute() method to copy to the clipboard.

Any suggestions?

 

Thanks.

Link to comment
Share on other sites

If you want to copy the current chart image to the clipboard you would do something like this

  System.IO.MemoryStream memoryStream = new System.IO.MemoryStream();

  chart1.Export(FileFormat.Png, memoryStream);

  memoryStream.Position = 0;

  System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(memoryStream);

  Clipboard.SetDataObject(new DataObject(DataFormats.Bitmap, bmp), true);

  bmp.Dispose();

If you are looking to copy the data to the clipboard as text we do not support this built-in, you could obviously retrieve the data using our API and copy the text to the clipboard though.

JuanC

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...