Draw a rotating line on a canvas


This is a hard one.

I am drawing the TCanva of a form using "Pixels [x, y] := MyColor;"

For example:
- Drawing area is 400x400 pixel starting at position 0,0.
- Draw a line from the center of the area (pos:200,200).
- Line length is half of area size 200 pixels (so it will never touch the corners...)
- Line width is always 1 pixel
Where it gets hard:
- The line color is diferent for each pixel
- The drawing area can change size
- I want to draw the line using radians
- I want to draw the line from center outward (so if the line is 200 pixels, pixel #1 is on center and #200 is at the end of the line)

Radians, pixel number, and color values come from a database. but for the purpouse of this project lets just assign a random value.

Hope you guys can help..
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

etiennedemersAuthor Commented:
Just to be cleared:

I want to call a function like

DrawAngleLine( RadValue)
Could also be in degrees, id doesn't mather
The tough part is figuring which pixels are to be drawn at a given angle...

etiennedemersAuthor Commented:
X=Radius * COS(angle)
Y=Radius * SIN(angle)

The rest is self explanatory...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.