WxPython zooming technique
<p>I am developing a wxpython project where I am drawing a diagram on to a panel that I need to be able to zoom in/out to this diagram(a directed acyclic graph in my case). I will achieve this by mouse scroll when the cursor is on the panel, however that is not a part of my question. I need an advice from an experienced person about the method I am using for zooming. So far I thought as doing,</p>

<ul>
<li>There are lines, rectangles and texts inside rectangles within this diagram. So maybe I could increase/decrease their length/size with the chosen mouse event. But it is hard to keep it balanced because rectangles are connected with lines their angles should not change, and texts inside the rectanges should stay in the middle of them.</li>
<li>Other method I thought of doing is to search for a built-in zoom method. Which I heard about something like <code>Scale</code>. However I have some questions about this method. Will this work on vector drawings(like mine) rather than images. And will it be scaling only the panel I chose and not the whole screen ? After I hear your advice about this, I will look deeper into this, but now I am a bit clueless.</li>
</ul>

<p>Sorry if my question is too <em>theoretical</em>. But I felt I needed help in the area. Thanks in advance.</p>

<p><strong>Note:</strong> Zooming not necessarily applied by scrolling.</p>

<p><strong>Note2:</strong> My research also led me to <code>FloatCanvas</code>. Is this suitable to my needs ?</p>

<p>Yes, from your description <code>FloatCanvas</code> would certainly meet your needs.  </p>

<p>Another possibility to consider would be the <code>wx.GraphicsContext</code> and related classes.  It is vector-based (instead of raster) and supports the use of a transformation matrix which would make zooming, rotating, etc. very easy.  However, the actual drawing and management of the shapes and such would probably require more work for you than using <code>FloatCanvas</code>.</p>

python wxpython zooming