
hPal property in Picture control (16 bit VB4)
Greetings,
I'm moving my VB-4 32-bit program back to VB-4 16-bit. I'm using 256
color
bitmaps loaded in PictureBox controls and am creating and assigning a
LogPalette to the picture. Here's my code to assign the palette to the
Picture in the PictureBox control:
Sub AssignPalette(aForm As Form, aPicture As Picture)
Dim hClip ' As ApiInt
Dim siReturn ' As ApiInt
Dim hPal As Long ' as ApiInt
hClip = OpenClipboard(aForm.hWnd)
If hClip = 0 Then
MsgBox "Can't open clipboard"
End
End If
' m_hPalette in the following line is a handle to my created palette
siReturn = SetClipboardData(vbCFPalette, m_hPalette)
hPal = GetClipboardData(vbCFPalette)
siReturn = CloseClipboard()
aPicture.hPal = hPal ' doesn't work in
16 bit VB4!!
End Sub
This works fine in 32-bit VB4 but it appears that you can't set the
Picture's
hPal property in 16-bit VB4. I can Get the existing hPal for the Picture.
Any suggestions?