Available in the LEADTOOLS Imaging toolkit. |
UserPalette and BitmapPalette example for Visual Basic
Note: Also works with Access 95 and 97.
This example demonstrates the UserPalette and BitmapPalette properties.
'Specify a blue and white user palette
Lead1.UserPalette(0) = RGB(0, 0, 255)
Lead1.UserPalette(1) = RGB(255, 255, 255)
'Implement the user palette
Lead1.ColorRes 1, CRP_USERPALETTE, CRD_ORDEREDDITHERING, 2
'Display the blue and white image
Lead1.ForceRepaint
MsgBox "This is the user palette. Click OK to change the bitmap palette."
'Change the bitmap palette to red and white
Lead1.BitmapPalette(0) = RGB(255, 0, 0)
Lead1.BitmapPalette(1) = RGB(255, 255, 255)
'Display the red and white image
Lead1.ForceRepaint