How to zoom in and out the image in the line using JSlider in java?
I have a diagonal line start开发者_高级运维ing from the bottom left part going to the upper right corner of the screen. I have also a human image drawn to a canvas having a 2 meters interval in the that diagonal line. I have created a JSlider below the canvas. Whenever I adjust the slider to the left, I want the images to zoom out and if it is to the right it will zoom in the images and that is my problem.
Could you give me some idea how to do it?
If you want to zoom in use
context.scale(scaleFactor,scaleFactor)
To zoom in use a number bigger then 1 and to zoom out use a number less then 1 like 0.6
精彩评论