I'm currently doing an image editor, i'm basing it from MultiLayer Image Editor, but I need to draw continously, and without having to pick the same tool (designer) after each draw. Because the behavior in MultiLayer Image Editor is when I clicked Add New Line, after adding a line, it goes back to Default (or selector), what I want is after adding a line, Line will still be my current tool.
There are two ways to implement the task. The first one is to inherit all required designers and redefine their behaviour. The second way - implement switch-back logic in your application. I think that it is preferred way for your case. Here is small code sample which illustrates the idea:
If this way is not acceptable for you do not hesitate to contact me. VObjects is a new module in the Graphics Mill for .NET product so any feedback is greatly appreciated.
thanks Alex, this works for line, rectangle, etc. but I'm using FreehandVObject, which does continues to draw even if i released my mouse left button. And also for TextVObject, can the end user edit the text directly inside the rubberband? and how do i prevent the Text from resizing if the end user resize the rubberband?
Thanks again, I am currently evaluating this component if this suits our application, before we do the purchase.
Yes, you are right - freehand object should be processed separately. I think that you can additionally check type of the object in the DesignerChanged event handler and allow changing of the designer for freehand.
As for text: no, unfortunately there is no possibilty to edit text in-place now. However, if it is really necessary for you, I can consult you how to implement this functionality, but it is not quite simple task. If you don't want text to be resized you can either turn off resizing at all, or turn on text area resizing. In such case the font itself will not be changed, just area filled with the text (you can see this behaviour in MultiLayerImageEditor sample). Here is small code snippet which shows how to turn on text area resize instead of usual resize: