?
Solved

RectTracker

Posted on 2006-04-20
9
Medium Priority
?
742 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:AlexFM
  • 5
  • 3
9 Comments
 
LVL 48

Author Comment

by:AlexFM
ID: 16495783
Idle_Mind, you are invited to write this class, I know that you like such things :-)
0
 
LVL 44

Accepted Solution

by:
bruintje earned 1600 total points
ID: 16495817
Hello AlexFM,

you could look at the download at
source: http://www.codecomments.com/archive292-2004-11-316766.html

hope this helps a bit
bruintje
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 400 total points
ID: 16498113
"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."

So you want to be able to draw resizeable/moveable boxes on top of a PictureBox?

Sorta like these?
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21158325.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21361303.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 48

Author Comment

by:AlexFM
ID: 16500766
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?
0
 
LVL 44

Expert Comment

by:bruintje
ID: 16500858
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
0
 
LVL 48

Author Comment

by:AlexFM
ID: 16501084
Zip is OK, thanks. I will test this project.
0
 
LVL 48

Author Comment

by:AlexFM
ID: 16501240
Looks like something that I am looking for, I need more time for testing. I will return to this question later.
0
 
LVL 48

Author Comment

by:AlexFM
ID: 16506715
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.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 16506766
thanks glad you got it working, hopefully it was at least easier then build from scratch :)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question