[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 833
  • Last Modified:

Draw a rotating line on a canvas

Gents,

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..
0
etiennedemers
Asked:
etiennedemers
  • 2
1 Solution
 
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...

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

The rest is self explanatory...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now