02-07-2011 10:31 PM
Hello, I have a custom image class that draws four circles on an image at each of the images points. I have the code that detects when the mouse is dragging from any one of these points. My question is how do I rescale the image according to how the user drags his mouse? Basically like any of those WYSIWYG image resizing tools across graphic programs.
02-07-2011 10:39 PM
Like this? (Fast forward to 1:22)
02-08-2011 10:36 AM
02-08-2011 12:41 PM - edited 02-08-2011 07:48 PM
I resolved the problem. I just needed to write out the concept on a piece of paper. I'll post the code for other people when I get to my computer.
02-08-2011 07:48 PM
Well I take that statement back. My code was really faulty.
I have NOT solved the issue. Any ideas? The image is in a custom class that extends Image. I need all the code to be in this custom class.
02-08-2011 08:11 PM
Personally, I would try adding the image to a Sprite or UIComponent that controls the corner handles and the resizing the of contained image. Typically, you have to add a transparent layer on top of the current window to track mouse movements and change the underlying item being moved or resized so you dont get into a race condition of the item falling out of the object being tracked because you moved too fast.
02-09-2011 08:27 PM
I have been a bit busy recently with a few other things so I haven't been able to sit down and finish this. I have made some progress though. The control is being added to a UIComponent instead of directly to the main stage. Part of the resizing works but I have to make a few changes for it to work better.