October 20, 2001

RotateBitmap – Rotate a 256-color bitmap by any angle

Option Explicit’ This structure holds Bitmap informationPrivate Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd Type’ This structure holds SAFEARRAY infoPrivate Type SafeArray2 cDims As Integer fFeatures As Integer cbElements As Long cLocks As Long

SwapColors – Swap any two colors in a 256-color bitmap

‘ This structure holds Bitmap informationPrivate Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd Type’ This structure holds SAFEARRAY infoPrivate Type SafeArray2 cDims As Integer fFeatures As Integer cbElements As Long cLocks As Long pvData

DrawPolygon – Draw a closed polygon with any number of sides

‘ Draw a polygon, given its center and number of sides’ CTRL can be either a form or a PictureBox control.’ ANGLE is an optional angle in degreesSub DrawPolygon(ctrl As Object, ByVal xc As Single, ByVal yc As Single, _ ByVal side As Single, ByVal numSides As Integer, _ Optional

GetBitmapInfo – Retrieve information on a bitmap

‘ This structure holds Bitmap informationPrivate Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd TypePrivate Declare Function GetObjectAPI Lib “gdi32” Alias “GetObjectA” (ByVal _ hObject As Long, ByVal nCount As Long, lpObject As Any) As

RotatePicture – Rotate a 256-color bitmap by any angle (super-optimized version)

‘ This structure holds Bitmap informationPrivate Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd Type’ This structure holds SAFEARRAY infoPrivate Type SafeArray2 cDims As Integer fFeatures As Integer cbElements As Long cLocks As Long pvData

SwapColorsArray – Swap all the colors in a 256-color bitmap

‘ This structure holds Bitmap informationPrivate Type BITMAP bmType As Long bmWidth As Long bmHeight As Long bmWidthBytes As Long bmPlanes As Integer bmBitsPixel As Integer bmBits As LongEnd Type’ This structure holds SAFEARRAY infoPrivate Type SafeArray2 cDims As Integer fFeatures As Integer cbElements As Long cLocks As Long pvData