|
ChartDriector and wxWidgets |
Posted by Gareth Fleming on Apr-11-2006 20:12 |
|
I have used the MFC sample code to try and draw a simple XYChart unto a wxFrame's DC, but I'm having no luck. Can anyone give me any pointers?
I'm currently doing this:
wxPaintDC cdc(this);
MemBlock m = c->makeChart(BMP);
wxBitmap bmp(m.data, wxBITMAP_TYPE_BMP, 250, 250);
cdc.DrawBitmap(bmp, 10, 10);
I thought that maybe rather than pass m.data to the wxBitmap constructor, I should pass m.data + *(int*)(m.data+10) to get to the actual bitmap data in the MemBlock, but that didn't help.
Thanks for your help |
Re: ChartDriector and wxWidgets |
Posted by Gareth Fleming on Apr-11-2006 20:54 |
|
Actually, with a bit more effort (who said I was lazy?!), I've come up with this (which actually works!):
wxPaintDC cdc(this);
MemBlock m = c->makeChart(BMP);
wxMemoryInputStream in(m.data, m.len);
wxBitmap bmp(wxImage(in, wxBITMAP_TYPE_BMP));
cdc.DrawBitmap(bmp, 10, 10);
Cheers,
Gareth |
Re: ChartDirector and wxWidgets |
Posted by Didier on Mar-14-2017 02:35 |
|
Thanks a lot. Would have been a long time before I'd stumbled upon wxMemoryInputStream!
Still working in 2017... |
|