copy a wxDC to wxScrolledWindow
Piotr Starczewski
pstarczewski at o2.pl
Mon Dec 4 04:56:17 PST 2006
That should not be a problem. First of all you need to get a
pointer/reference to your source wxDC. Then just wxDC::Blit it into
wxMemoryDC with selected bitmap. Final step is to rescale your bitmap
and draw it with wxDC::DrawBitmap(...) onto your scrolled window.
Regards,
Peter
Miguel Cartagena wrote:
> Sorry, I'll try to explain the problem better.
>
> I have a wxDC drawn before, outside my application. So, I don't know
> what is drawn in it and I can't "do my drawing" :)
> What I want to do is: get this DC, rescale to my ScrolledWindow size
> and show it into my ScrolledWindow.
>
> For this, copy the DC it's not enough, I think. A possible solution is
> redraw the DC that I receive on MyScrolledWindow::OnDraw(wxDC& dc)
> method, or something like.
>
> void DCReceiver::ReceiveDC(wxDC& dc){
> MyScrolledWindow::Draw(dc);
> }
>
> ...
>
> void MyScrolledWindow::Draw(wxDC& dc){
> dc.Redraw(); // the wxDC::Redraw() method not exists, therefore my
> doubt.
> }
>
> void MyScrolledWindow::OnDraw(wxDC& dc){
> Draw(dc); // rewrite the wxScrolledWindow::OnDraw method ?
> }
>
> Thanks and regards,
> Miguel
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
>
>
>
More information about the wx-users
mailing list