Skip to content

Copying a chart to the clipboard? #9

Answered by utelle
tonyvsuk asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, the memory block returned by makeChart(Chart::BMP) can't be passed directly to a wxBitmap constructor. First, you have to convert the memory block to a wxImage object that then can be passed to a wxBitmap constructor.

The code looks like this:

  MemBlock block = c->makeChart(Chart::BMP);
  wxMemoryInputStream in(block.data, block.len);
  wxBitmap bmp(wxImage(in, wxBITMAP_TYPE_BMP));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tonyvsuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants