Re: Scaling/Resizing 2D graphics in JPanel



you can inherite your own canvas class from JPanel. in this class,
define zero point and rate.
then there will be two coordinate: absolute coordinate and relative
coordinate.
the shapes or components that store in it are scaled by relative
coordinate.
when need draw them on canvas, canvas convert them from relative
coordinate to absolute coordinate.
zoomin or zoomout modify its rate. move canvas modify its zero point.

.



Relevant Pages

  • Re: Get Rid Of Tkinter Canvas Border
    ... My program places a Canvas ... > object on a parent Frame. ... > 'white' and both have borderwidth set to zero. ... > For some reason there is always tiny grey border drawn ...
    (comp.lang.python)
  • Re: Canvas
    ... flickering on systems which are not double buffered (such as Mac X). ... Window1.Canvas1.Graphics.DrawPicture ThisPicture, 0, 0 ... better off making a canvas class and assigning each canvas to that class. ...
    (comp.lang.basic.realbasic)