I wrote a Turbo Pascal application awhile ago that calculated cross-sectional
properties (area, principal axes, second-moment of area, etc) and drew the
cross-section on the screen. This code draws a line and an arc:
procedure SecPropWindow.Paint(PaintDC:HDC; var PaintInfo: TPaintStruct);
begin
ThePen := CreatePen(ps_Solid, 2, RGB(0,0,0));
OldPen := SelectObject(PaintDC, ThePen);
MoveTo(PaintDC, X[i], Y[i]);
LineTo(PaintDC, X[i+1], Y[i+1]);
Arc(PaintDC,TopLeftX,TopLeftY,BottRightX,BottRightY,ArcStartX,ArcStartY,ArcEndX,ArcEndY);
SelectObject(PaintDC, OldPen);
DeleteObject(ThePen);
end;
end;
The parameters for the moveto, lineto, and arc commands are the same as they in
Delphi, with the addition of the handle of the canvas.
I'll email you the full source.
> Rory Barrett wrote:
>
> I am teaching this language to a fourth form at St Kentigern College. Does anyone
>know a simple method for doing graphics using this wretched language. It is quite
>easy using Delphi, Visual basic and Java but when I try lineto in this language I
>fail to get a result.
>
> If anyone knows how you would go about getting a simple line, arc and ellipse on the
>screen and jot down the code I would be much appreciative.
>
> The Help files in TP 1.5 are devoid of any illustrative examples.
>
> Many Thanks
> Rory Barrett
--
John Mason
Sinclair Knight Merz Limited
54 The Terrace, Wellington, New Zealand
Phone: +64-4-473 4265, Fax: +64-4-473 3369
--
NOTICE - This message contains privileged and confidential information intended only
for the use of the addressee named above. If you are not the intended recipient of
this message you are hereby notified that you must not disseminate, copy, or take any
action in reliance
on it. If you have received this message in error please notify Sinclair Knight Merz
Limited immediately. Any views expressed in this message are those of the individual
sender, except where the sender has the authority to issue and specifically states
them to be the
views of Sinclair Knight Merz.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"