This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I would like a zoom window feature, but I have a hard time seeing how it should be approached..... can you help? I'm thinking that it must act in the way that you click and drag a window, and then it zooms to fit with the window. Regards, Michael |
|
|
Hello Michael The easiest way to do this would be to hi-jack the marquee select rectangle and use this as a zoom box. The main thing to do is attach an event handler to DiagramSurface.MarqueeDragCompleted. In the event handler, all you need to do is something like this:
Where ds is a DiagramSurface instance. This simply sets the logical viewport of the diagram to be the logical rectangle of the marquee selector. You probably also want to disbable selection while you are hi-jacking the marquee rectangle. To do this, you simply attach an event handler to DiagramSurface.MarqueeDragDelta, and in the event handler set e.Handled = true. Another option would be to create your own control that overlays the DiagramSurface to provide your own zoom box logic and visuals. Let me know if you need help going down this route. One thing to note is that while zooming, you can not change the aspect ratio of the DiagramSurface. That is, the ratio between the width and height will always be the same so that you don't stretch the diagram. So if the diagram is wide and short, and the user creates a zoom box that is skinny and tall, the DiagramSurface will use uniform-zoom logic which may be perceived as a bug in the zoom box. (try this out for yourself). If you want to avoid this, you would want to cause the aspect ratio of the zoom box to always be the same as the aspect ratio of the DiagramSurface. You can not modify the marquee rectangle, so if you wanted to achieve this, you would need to take my second option of creating your own zoom box overlay control. Jason Fauchelle |
|
|
Exactly what I needed. Thanks! Regards, Michael |
|