Link to home
Start Free TrialLog in
Avatar of AlexFM
AlexFM

asked on

RectTracker

I am looking for .NET class which works like MFC CrectTracker. RectTracker from CodeProject http://www.codeproject.com/cs/miscctrl/CSharpRectTracker.asp is good for moving controls on the form, but I need object which moves itself over image. It should not be control itself, and should not contain other controls - exactly like MFC CRectTracker - just draws itself and handles mouse messages.
If there is such class, please post a link.
Avatar of AlexFM
AlexFM

ASKER

Idle_Mind, you are invited to write this class, I know that you like such things :-)
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexFM

ASKER

Idle_Mind, this class is working, but requires a lot of client code. I am looking for something that fully encapsulates all functionality, with minimum client code.
CRectTracker has the following interface:
1) public Rectangle member which can be set and read.
2) Virtual Draw function which draws rectangle and resizing handles (both rectangle and handles are optional). Called by client from WM_PAINT handler.
3) HitTest function which detects whether tracker is clicked. Called by client from WM_MOUSEDOWN handler.
4) Track function which moves/resizes tracker. This function is called by client when HitTest is positive. Function returns when user releases mouse button. During resizing/moving CRectTracker draws itself using DrawFocusRect, without invalidating parent window.

I am looking something like this.

bruintje, my WinRar cannot open rar archive from your link. Do you have another link, or maybe you can post the code?
can post it as a zip here
http://www.traktiq.net/ee_temp/RectTacker47.zip

still no go then i'll open it up and post here
Avatar of AlexFM

ASKER

Zip is OK, thanks. I will test this project.
Avatar of AlexFM

ASKER

Looks like something that I am looking for, I need more time for testing. I will return to this question later.
Avatar of AlexFM

ASKER

Life is not so easy, I spent some time with CRectTracker class. Finally I removed 70% of it's code, reduced functionality to minimum required for my case, fixed some bugs and got working version.
bruintje, thank you for the link. Idle_Mind, thank you for some ideas in your implementation.
thanks glad you got it working, hopefully it was at least easier then build from scratch :)