Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TCanvas.Circle

Posted on 1998-12-20
5
Medium Priority
?
240 Views
Last Modified: 2010-04-04
Hi,
I need a procedure which draws a circle. The Code should be
procedure circle (x,y,r : Integer) x,y = Middle r = radius.
0
Comment
Question by:ItsMe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 4

Accepted Solution

by:
dwwang earned 0 total points
ID: 1352156
TCanvas.Ellipse(X1, Y1, X2, Y2: Integer);

According to you requirement,
X1:=x-r;
Y1:=y-r;
X2:=x+r;
Y2:=y+r;
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352157
Here is something for ya...

procedure Circle(x,y, r : Integer; Where : TCanvas);
var
  a : integer;
begin
  for a := 0 to 359 do
    Where.Pixels[round(x+cos(a/180*pi)*r),round(y+sin(a/180*pi)*r)] := clBlack;
end;

Example call:

Circle(Form1.Width shr 1, Form1.Height shr 1, 50, Form1.Canvas);

Hope this helps...

-Viktor
--Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352158
Which comment answer helped you solve your problem?? I'm just curious...
0
 

Author Comment

by:ItsMe
ID: 1352159
No one. I took a cheat of paper, draw a rectangle with a circle and thought that I only have to find out the radius to solve my problem. I knew the mouse up point and from this point i ad to go radius left and radius right and up and down the same.
(:-)
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352160
That would take quite a long time to accomplish... You need to change the Xs and Ys in order to be able to do it that way, and it really is a cheap way of doin' it...

Merry Christmas!

Take care o' ya

-Viktor
--Ivanov
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
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

610 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