Module Code: Declare Function SetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Long Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long Global Rot_90 = 1 Global Rot_180 = 2 Global Rot_270 = 3 'Starting Points must equal each other 'Width and Height of object will must make a square 'nSquRoot stands for the square root of the square ''''''''''''''''''''''hDc of PictureBox'''''''''Square Root''''''''''''Degrees to be rotated'' Function RotateBlt (ByVal hDC As Integer, ByVal nSquRoot As Integer, ByVal rDegree As Integer) nSquRoot = nSquRoot - 1 ReDim tmpBit(0 To nSquRoot, 0 To nSquRoot) As Long Select Case rDegree Case 1 '90 degree turn For i = 0 To nSquRoot For j = 0 To nSquRoot tmpBit(nSquRoot - j, i) = GetPixel(hDC, i, j) Next j Next i Case 2 '180 degree turn For i = 0 To nSquRoot For j = 0 To nSquRoot tmpBit(nSquRoot - i, nSquRoot - j) = GetPixel(hDC, i, j) Next j Next i Case 3 '270 degree Turn For i = 0 To nSquRoot For j = 0 To nSquRoot tmpBit(i, nsquRoot - j) = GetPixel(hDC, j, i) Next j Next i End Select For i = 0 To nSquRoot For j = 0 To nSquRoot g = SetPixel(hDC, i, j, tmpBit(i, j)) Next j Next i End Function