Question
Hello, I am trying to zoom into an image upon pressing and releasing the mouse.I need help The image must be zoomed in by 120%
Hello, I am trying to zoom into an image upon pressing and releasing the mouse.I need help The image must be zoomed in by 120% at the same spot where the mouse was
public void doMouse(String action, double x, double y){ if(action.equals("pressed")){ this.Xpos = x; this.Ypos = y; } else if (action.equals("released")){
} }
// CHALLENGE /** * Expand the image around the pixel in row r and column c. * The zoom should be 120% - every pixel moved 120% further from (r,c) than originally. * Hint: It is much easier to copy pixel values from the current image to their * new positions in a new array, and then replace the original array by the new one. */ public void zoomImage(int r,int c){
this.redisplayImage(); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started