Arrows.


 I need some ideas to draw arrows with different types of
arrow-heads .Any information will be welcome.
e6694811Asked:
Who is Participating?
 
migelConnect With a Mentor Commented:
Can I answer?
0
 
migelCommented:
Hi!
What arrows you want to draw and where? Is it Window Control or Data Graph app?
0
 
e6694811Author Commented:
Hi ,migel.

 Yes ,it's a graph application(MDI) where I can draw several types of figures ,including arrows.These figures must be displayed at the child view .I still haven't decided what is the
set of arrows to be drawn ,perhaps I need a kind of
template.

 Let me know if MFC provides any function to do this.
Otherwise I 'll look for for some thecniques.

Greets.


 
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
migelCommented:
I think that MFC doesn`t help you.
You must draw it yourself.
Technique cane be like this:
1.Define pure virtual class (let it be CGraphArrow) and determine several methods (virtual) common for all arrows
for example:
 Draw(CDC* ) and etc..
 (do not forget declare virtual destructor)
2. Derive class for each arrow type from this base (CGraphArrow) and implement its own alghoritms for each common method.
3. In the client part create appropriate constructor for arrow type you need.
CGraphArrow* pArrow = new CSimpleArrow;
// it is important to use pointer to the generic class since your code become independent from specific arrow type :-)
4. Draw arrow by caling pArrow->Draw(pDC);
5. destroy pointer delete pArrow;
It is all (in general)
As Arrow common parameters you can define:
1. Geoemetric data:
point of arrow place, set of verticies and number of verticies.
2. Visual data:
arrow color
With this methods you can simple define such operations as rotate arrow and move arrow.
0
 
e6694811Author Commented:

 So I have to do everything by myself .Wonderful !

 I'll wait for another response if exists .If I don't receive an answer in a reasonable amount of time ,I'll give you the
points and close this question.
0
 
olgatCommented:
You can easily draw all types of arrows by using CDC::DrawFrameControl() method
with the second parameter (nType) set to DFC_SCROLL and the third parameter set to one of:
DFCS_SCROLLDOWN  
DFCS_SCROLLLEFT  
etc.

See help on this method for more explanation
0
 
migelCommented:
Hi!
>>olgat
Take in mind previous discussion  :-)
0
 
olgatCommented:
Hi migel:
I am sorry, I really don't understand what is wrong there
0
 
migelCommented:
Hi olgat
CDC::DrawFrameControl() draw ENTIRE scroll button with arrow :-)
As e6694811say he need graphical <vector> arrows not bitmaps.
0
 
olgatCommented:
You can draw it without a button with these rows:

CRect rectFrame(myRect);
dc.DrawFrameControl(rectFrame, DFC_SCROLL, DFCS_SCROLLDOWN|DFCS_FLAT);

COLORREF color = dc.GetPixel(1,1);
CBrush brush(color);
dc.FrameRect(rectFrame, &brush);

BUT there is a restriction:
It would work on plain one-colored backgrounds only, here you are right,  I should have specified it above...
0
 
e6694811Author Commented:

 Hi ,Migel & olgat.Sorry for not coming back sooner.


 Olgat ,I 've just taken a look at DrawFrameControl() and I think
there is a big restriction :I only can use a fixed number of
arrows.

 As I said In my earlier messages ,I need to define my own
set of arrows (for instance ,defining a set of vertices for each
arrow)

 Well perhaps it's time that I give the points to miguel.
0
 
e6694811Author Commented:

 Sure !
0
All Courses

From novice to tech pro — start learning today.