That should do a standard rotation, around the upper left corner.Code:Dim cA as Single Dim sA as Single cA = Cos(Theta*(3.14159/180)) sA = Sin(Theta*(3.14159/180)) Dim l as Single Dim i as Long Dim j as Long For i = 0 to width For j = 0 to height l = sqr(i^2 + j^2) SetPixel(l*cA, l*sA, GetPixel(i, j)) Next j Next i
Now, for the translation...
Try that... Im not sure if it will work (its off the top of my head, and I cant test it).Code:Dim cA as Single Dim sA as Single Dim cX as Long Dim cY as Long Dim dcX as Long Dim dcY as Long cA = Cos(Theta*(3.14159/180)) sA = Sin(Theta*(3.14159/180)) Dim l as Single Dim i as Long Dim j as Long cX = width/2 cY = height/2 dcX = destWidth/2 dcY = destHeight/2 For i = 0 to width For j = 0 to height l = sqr((cX+i)^2 + (cY + j)^2) SetPixel(l*cA+dcX, l*sA+dcY, GetPixel(i, j)) Next j Next i
Z.




Reply With Quote