I downloaded this from my home computer...
You have to put it in a module.

Use the GetBitmapData to get the bitmap as an array, so you can manipulate the data, and SetBitmapData to put the data back in the PictureBox.
For the SetBitmapData, the value param is a long, so you will have to use the VarPtr(YourArray(0)) function to get the array pointer.

The functions works in 24 bits, so it does not matter how many bits per pixel your screen resolution has, it will always convert to 24 bits. And SetBitmapData function it's expecting that you pass a 24 bit bitmap data to it.

You will need these functions even when I'll make the C++ rotation, cuz you need to pass the pointer to the data to the DLL.
VB Code:
  1. Option Explicit
  2.  
  3. Public Const BI_RGB = 0&
  4. Public Const BI_RLE4 = 2&
  5. Public Const BI_RLE8 = 1&
  6.  
  7. Public Const DIB_RGB_COLORS = 0 '  color table in RGBs
  8. Public Const DIB_PAL_COLORS = 1 '  color table in palette indices
  9. Public Const DIB_PAL_INDICES = 2 '  No color table indices into surf palette
  10. Public Const DIB_PAL_PHYSINDICES = 2 '  No color table indices into surf palette
  11. Public Const DIB_PAL_LOGINDICES = 4 '  No color table indices into DC palette
  12.  
  13. Public Const SRCCOPY = &HCC0020         ' (DWORD) dest = source
  14.  
  15. Public Type SAFEARRAYBOUND
  16.     cElements As Long
  17.     lLbound As Long
  18. End Type
  19.  
  20. Public Type SAFEARRAY2D
  21.     cDims As Integer
  22.     fFeatures As Integer
  23.     cbElements As Long
  24.     cLocks As Long
  25.     pvData As Long
  26.     Bounds(0 To 1) As SAFEARRAYBOUND
  27. End Type
  28.  
  29. Public Type BITMAPINFOHEADER '40 bytes
  30.     biSize As Long
  31.     biWidth As Long
  32.     biHeight As Long
  33.     biPlanes As Integer
  34.     biBitCount As Integer
  35.     biCompression As Long
  36.     biSizeImage As Long
  37.     biXPelsPerMeter As Long
  38.     biYPelsPerMeter As Long
  39.     biClrUsed As Long
  40.     biClrImportant As Long
  41. End Type
  42.  
  43. Public Type BITMAPINFO
  44.     bmiHeader As BITMAPINFOHEADER
  45.     bmiColors As Long ' RGBQUAD
  46. End Type
  47.  
  48. Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
  49. Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
  50. Public Declare Function CreateDIBSection Lib "gdi32" (ByVal hdc As Long, pBitmapInfo As BITMAPINFO, ByVal un As Long, lplpVoid As Long, ByVal handle As Long, ByVal dw As Long) As Long
  51. Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  52. Public Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
  53. Public Declare Function GetCurrentObject Lib "gdi32" (ByVal hdc As Long, ByVal uObjectType As Long) As Long
  54. Public Declare Function GetObjectType Lib "gdi32" (ByVal hgdiobj As Long) As Long
  55. Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
  56. Public Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
  57. Public Declare Function GetObjectAPI Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
  58. Public Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpbi As BITMAPINFO, ByVal wUsage As Long) As Long
  59. Public Declare Function SetDIBits Lib "gdi32" (ByVal hdc As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpbi As BITMAPINFO, ByVal wUsage As Long) As Long
  60. Public Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long
  61. Public Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
  62. Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  63. Public Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
  64.  
  65. Public Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (Ptr() As Any) As Long
  66.  
  67. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
  68.  
  69.  
  70. Public Function GetBitmapData(hdc As Long, Width As Long, Height As Long, value() As Byte, Optional ByVal ReSize As Double = 1) As Boolean
  71.     Dim bi As BITMAPINFO, mhDC As Long, bitsPtr As Long, hDIB As Long
  72.     Dim bDibFrom() As Byte, Size As Long, old_bmp As Long, Ret As Long
  73.     Dim RWidth As Integer, RHeight As Integer
  74.     Dim tSAFrom As SAFEARRAY2D
  75.    
  76.     mhDC = CreateCompatibleDC(0)
  77.     If mhDC <> 0 Then
  78.         With bi.bmiHeader
  79.             .biSize = Len(bi.bmiHeader)
  80.            
  81.             If ReSize <> 1 Then
  82.                 RWidth = Width * ReSize
  83.                 .biWidth = RWidth
  84.                 RHeight = Height * ReSize
  85.                 .biHeight = RHeight
  86.             Else
  87.                 .biWidth = Width
  88.                 .biHeight = Height
  89.             End If
  90.            
  91.             .biPlanes = 1
  92.             .biBitCount = 24
  93.             .biCompression = BI_RGB
  94.             .biSizeImage = BytesPerScanLine(.biWidth, .biBitCount) * .biHeight
  95.         End With
  96.        
  97.         hDIB = CreateDIBSection(mhDC, bi, DIB_RGB_COLORS, bitsPtr, 0, 0)
  98.        
  99.         If hDIB <> 0 Then
  100.             old_bmp = SelectObject(mhDC, hDIB)
  101.            
  102.             If ReSize <> 1 Then
  103.                 Ret = StretchBlt(mhDC, 0, 0, Width * ReSize, Height * ReSize, hdc, 0, 0, Width, Height, SRCCOPY)
  104.             Else
  105.                 Ret = BitBlt(mhDC, 0, 0, Width, Height, hdc, 0, 0, SRCCOPY)
  106.             End If
  107.         Else
  108.             DeleteDC mhDC
  109.             Exit Function
  110.         End If
  111.     End If
  112.    
  113.     Size = bi.bmiHeader.biSizeImage
  114.    
  115.     If (Size > 0) Then
  116.         ReDim value(Size - 1)
  117.        
  118.         With tSAFrom
  119.             .cbElements = 1
  120.             .cDims = 2
  121.             .Bounds(0).lLbound = 0
  122.             .Bounds(0).cElements = bi.bmiHeader.biHeight
  123.             .Bounds(1).lLbound = 0
  124.             .Bounds(1).cElements = BytesPerScanLine(bi.bmiHeader.biWidth, bi.bmiHeader.biBitCount)
  125.             .pvData = bitsPtr
  126.         End With
  127.        
  128.         CopyMemory ByVal VarPtrArray(bDibFrom()), VarPtr(tSAFrom), 4
  129.         CopyMemory value(0), bDibFrom(0, 0), Size
  130.        
  131.         'Clear the temporary array descriptor, This is necessary under NT4.
  132.         CopyMemory ByVal VarPtrArray(bDibFrom), 0&, 4
  133.     End If
  134.    
  135.     DeleteObject hDIB
  136.     SelectObject mhDC, old_bmp
  137.     DeleteDC mhDC
  138.    
  139.     GetBitmapData = True
  140. End Function
  141.  
  142. Public Function SetBitmapData(ByVal hdc As Long, ByVal Width As Long, ByVal Height As Long, ByVal value As Long, Optional ByVal ReSize As Double = 1) As Boolean
  143.     Dim bi As BITMAPINFO, mhDC As Long, bitsPtr As Long, hDIB As Long
  144.     Dim bDibFrom() As Byte, old_bmp As Long, Ret As Long
  145.    
  146.     mhDC = CreateCompatibleDC(0)
  147.     If mhDC <> 0 Then
  148.         With bi.bmiHeader
  149.             .biSize = Len(bi.bmiHeader)
  150.             .biWidth = Width
  151.             .biHeight = Height
  152.             .biPlanes = 1
  153.             .biBitCount = 24
  154.             .biCompression = BI_RGB
  155.             .biSizeImage = BytesPerScanLine(.biWidth, .biBitCount) * .biHeight
  156.         End With
  157.        
  158.         hDIB = CreateDIBSection(mhDC, bi, DIB_RGB_COLORS, bitsPtr, 0, 0)
  159.        
  160.         If hDIB <> 0 Then
  161.             old_bmp = SelectObject(mhDC, hDIB)
  162.             Ret = SetDIBits(mhDC, hDIB, 0, bi.bmiHeader.biHeight, ByVal value, bi, DIB_RGB_COLORS)
  163.            
  164.             If ReSize <> 1 Then
  165.                 Ret = StretchBlt(hdc, 0, 0, Width * ReSize, Height * ReSize, mhDC, 0, 0, Width, Height, SRCCOPY)
  166.             Else
  167.                 Ret = BitBlt(hdc, 0, 0, Width, Height, mhDC, 0, 0, SRCCOPY)
  168.             End If
  169.         Else
  170.             DeleteDC mhDC
  171.             Exit Function
  172.         End If
  173.     End If
  174.    
  175.     DeleteObject hDIB
  176.     SelectObject mhDC, old_bmp
  177.     DeleteDC mhDC
  178.    
  179.     SetBitmapData = Ret > 0
  180. End Function
  181.  
  182. Public Function BytesPerScanLine(Width As Long, BitCount As Integer) As Long
  183.     BytesPerScanLine = (Width * BitCount)
  184.     If (BytesPerScanLine Mod 32 > 0) Then BytesPerScanLine = BytesPerScanLine + 32 - (BytesPerScanLine Mod 32)
  185.     BytesPerScanLine = BytesPerScanLine \ 8
  186. End Function