Laurent Veilleux wrote:
> thanks for you fast answer Klaas
> when I was speaking about drawing I meant drawing like in paint (keeping
> the left button of the mouse pressed draw add new point to the current
> line each time user move it) it's why I am trying to modify polyline
> tool by overiding the OnMouseEvent
That is what is called freehand.
The thing is to simplify the polyline to enough segments. Often after ending
the polyline it is converted to a bezier
curve. I have the article at home, but no time to implement it.
If you mannge it, i be interested to add it.
>
> About tool in fact when you select a new tool, the old previous one is
> popped automatically by the toolController?
Depends on the situation. For drawing tools that is not required.
You can decide yourself often, like here with a menu, you can pop.
void MDIEditorFrame::EndTool( wxCommandEvent& event )
{
a2dSmrtPtr< a2dBaseTool > tool;
m_contr->PopTool( tool );
}
The drawing of a primitive, followed by directly editing it, using a oneshot
tool, is a situation where the last tools
pushed is automatically poped again.
Also the zoomtool via the mouse menu, can be pushed while drawing. This makes
it possible to draw very accurate.
The thing is that a tool stack is the basic mechanism.
>
> Currently I want to save annotation document painted over a diagramm
> image, how could I display a background image in my canvas object
Normal backgorund colours:
void a2dCanvasView::SetBackgroundFill( a2dFill* backgroundfill )
The next is virtual, so you can derive and redefine whatever you want to draw
in the back.
void a2dCanvasView::PaintBackground( int x, int y, int width, int height )
, how
> to resize the canvas with the size of the bitmap and handle zoom with it
> ???
Don't understand exactly.
If the size of the bitmap changes, you want to fit the a2dCanvas around it?
Or you can always scale the bitmap using wxImage to fit inside whatever canvas.
Maybe doing it here in a derived class event handler of On:
EVT_SIZE( a2dCanvas::OnSize )
void a2dCanvas::OnSize(wxSizeEvent& WXUNUSED(event) )
And what is there to zoom? Zoom into the bitmap too? But then it is not the
size of the bitmap anymore??
Maybe the easiest way is to add a a2dImage object with your bitmap in it, to
the a2dCanvas. (one layer, not editable etc.)
Next put the rest of your anotation on top of it.
And set the a2dCanvasView mapping such that at zoom out, the total bitmap
object is seen.
Now you have zooming and all taht for free, without doing anything extra.
Klaas
--
Unclassified
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wxart2d-users_dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev