Solved

Drawing a triangle

Posted on 2002-05-03
4
1,212 Views
Last Modified: 2008-02-01
Is there an easy way to draw a triangle on screen without having to use canvas funtions and stuff?

Thanks
0
Comment
Question by:Gareth_Hastings
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
? without using direct tcanvas-methods

well you could print a triangle on a printer using a symbol-font-char ($D1), then scan the print and save as bitmap
then code your app ,use there a timage and load this bitmap into it :-))

just kiding

i used this for drawing a sorting triangle on a gridcolumntitle (a static triangle)

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
const CMargin = 5;
begin
  If (ARow = 0) and (ACol = FSortedColIndex) then  //FSortedColIndex->the col, which is sorted
  case FSortOrder of
    true : begin  //Ascending
             StringGrid1.Canvas.Pen.Color := clbtnShadow;
             StringGrid1.Canvas.MoveTo(Rect.Right-CMargin,Rect.Top+CMargin);
             StringGrid1.Canvas.LineTo(Rect.Right-7-CMargin,Rect.Top+CMargin);
             StringGrid1.Canvas.LineTo(Rect.Right-4-CMargin,Rect.Top+7+CMargin);
             StringGrid1.Canvas.Pen.Color := clBtnHighLight;
             StringGrid1.Canvas.LineTo(Rect.Right-CMargin,Rect.Top+CMargin);
           end;
   false : begin  //Descending
             StringGrid1.Canvas.Pen.Color := clBtnHighLight;
             StringGrid1.Canvas.MoveTo(Rect.Right-4-CMargin,Rect.Top+CMargin);
             StringGrid1.Canvas.LineTo(Rect.Right-CMargin,Rect.Top+7+CMargin);
             StringGrid1.Canvas.LineTo(Rect.Right-7-CMargin,Rect.Top+7+CMargin);
             StringGrid1.Canvas.Pen.Color := clbtnShadow;
             StringGrid1.Canvas.LineTo(Rect.Right-4-CMargin,Rect.Top+CMargin);
           end;
  end;
end;

well tell a bit more about your triangle

meikl ;-)
0
 
LVL 1

Author Comment

by:Gareth_Hastings
Comment Utility
0
 
LVL 1

Expert Comment

by:pnh73
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ/No Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 

Accepted Solution

by:
YensidMod earned 0 total points
Comment Utility
Question is PAQ'd and no points refunded.

YensidMod
Community Support Moderator @Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now