Re: [Wxart2d-users_dev] Drawing to a canvas
Status: Beta
Brought to you by:
titato
|
From: klaas.holwerda <ng...@kl...> - 2016-12-08 17:18:22
|
Hi,
I did add something to the simple example to show how to do it.
I think you forgot to set the display window, see this code:
MyDrawingPart* part = new MyDrawingPart( size.GetWidth(),size.GetHeight() );
part->SetShowObject( m_canvas->GetDrawing()->GetRootObject() );
part->SetDisplayWindow( m_canvas );
m_canvas->SetDrawingPart( part )
On 12/07/2016 11:32 PM, Mike Gibson wrote:
> Hi Klaas,
>
> I followed your suggestion and created a class: MyDrawingPart : public a2dDrawingPart.
>
> I redefined a2dDrawingPart::UpdateArea with my own MyDrawingPart::UpdateArea. I then copied the
> code for that function verbatim out of drawer.cpp.
>
> I created an a2dSmrtPtr<MyDrawingPart> m_DrawingPart, and created a new one.
>
> I then assigned the drawing part to my a2dCanvas: CieDiagram->SetDrawingPart(m_DrawingPart).
>
> Now whenever I pull up the canvas, it is always blank. It never displays the image or anything.
>
> If I comment out the assignment (CieDiagram->SetDrawingPart(m_DrawingPart)), and use the
> a2dCanvas' default drawing part, everything works fine. Is there another step I need to perform?
>
> - Mike
|