Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Resize Image With Mouse

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.

From,
Noah NU
Please use plain text.
Developer
jffurlan
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)

Re: Resize Image With Mouse

Like this? (Fast forward to 1:22)

 

http://www.youtube.com/watch?v=YZkR9ZoaugI

- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: Resize Image With Mouse

Exactly like that.

From,
Noah NU
Please use plain text.
Developer
jffurlan
Posts: 1,003
Registered: ‎01-16-2011
My Device: PlayBook (sim)

Re: Resize Image With Mouse

(sorry, I really don't have an answer but just thought it might help anyone else see exactly what you meant)
- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: Resize Image With Mouse

[ Edited ]

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.

From,
Noah NU
Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: Resize Image With Mouse

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.

From,
Noah NU
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Resize Image With Mouse

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.

Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: Resize Image With Mouse

Thanks for the advice. I am currently in the process of redesigning / rewriting my classes that control the resizable objects. So far it is going well.

From,
Noah NU
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Resize Image With Mouse

Have you made any progress with this?

Please use plain text.
Developer
noahnu
Posts: 138
Registered: ‎01-09-2011
My Device: Blackberry Tablet OS

Re: Resize Image With Mouse

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.

From,
Noah NU
Please use plain text.