The problem I have is rotating this art. Rather than going the long winded way of increasing and decreasing numbers in the MoveTo and LineTo procedures is there a way I can rotate this canvas art at any angle (e.g. right now it is facing north or 0 degrees but rotating it 45 degrees would make it face north east). Now I'm not good at copying functions from the internet so if you are going to help me, please paste the additional code inside the code that I have provided above and provide a brief explanation of how it works.
I'll give you just the math, perhaps it will get you started. This assumes the point of rotation to be (0, 0). Assume point P(10, 20).
If you want to rotate this point 45 degrees, then you have to do the following:
angle := 45 * pi / 180; // conversion of degrees to radials
Q(x, y) is calculated as follows:
x := 10 * cos(angle) - 20 * sin(angle); // 10 = Px, 20 = Py
y := 20 * cos(angle) + 10 * sin(angle);
You have to create two images first. I'm sure anyone could convert this code to use just on image by using a TBitmap.
Procedure TurnImage(Src, Dst: TImage);
var x,y: integer;
Dst.Width:= Src.Height; Dst.Height:= Src.Width;
For x:= 0 to Src.Width-1 do begin
For y:= 0 to Src.Height-1 do begin