Changing palettes in a PictureBox 
Author Message
 Changing palettes in a PictureBox

Hi,

I'm following an example in VB6 "Managing Multiple Color Palettes" to
change a palette in a PictureBox

Here's my code.  It does nothing.

Public Sub Make_Fake_BMP()

Dim Pic As StdPicture

Set Pic = LoadPicture()
Set Pic = LoadPicture( "test.bmp")

frmJOHO.Palette = Pic
frmJOHO.PaletteMode = vbPaletteModeCustom
frmJOHO.Refresh

Set Pic = LoadPicture()
End Sub

frmJOHO is filled with a PictureBox called PicJOHO which has already
been loaded with a 256-color bitmap using PaintPicture. Test.bmp has a
different palette than the one loaded in PicJOHO. I want the palette
used to display PicJOHO to change to the one in test.bmp.

Seems like I'm just doing as the example says.  Any ideas?

TIA
Duncan



Tue, 28 Dec 2004 05:44:15 GMT  
 Changing palettes in a PictureBox
I've never done this before, but I think that the repeated line "Set Pic =
LoadPicture()" may empty the variable effectively, so that it is not
unexpected that it does nothing.

Just remove this line twice and it may work.

Neil


Quote:
> Hi,

> I'm following an example in VB6 "Managing Multiple Color Palettes" to
> change a palette in a PictureBox

> Here's my code.  It does nothing.

> Public Sub Make_Fake_BMP()

> Dim Pic As StdPicture

> Set Pic = LoadPicture()
> Set Pic = LoadPicture( "test.bmp")

> frmJOHO.Palette = Pic
> frmJOHO.PaletteMode = vbPaletteModeCustom
> frmJOHO.Refresh

> Set Pic = LoadPicture()
> End Sub

> frmJOHO is filled with a PictureBox called PicJOHO which has already
> been loaded with a 256-color bitmap using PaintPicture. Test.bmp has a
> different palette than the one loaded in PicJOHO. I want the palette
> used to display PicJOHO to change to the one in test.bmp.

> Seems like I'm just doing as the example says.  Any ideas?

> TIA
> Duncan



Tue, 28 Dec 2004 16:05:39 GMT  
 Changing palettes in a PictureBox
Neil:

Quote:
> I've never done this before, but I think that the repeated line "Set Pic =
> LoadPicture()" may empty the variable effectively, so that it is not
> unexpected that it does nothing.

> Just remove this line twice and it may work.

Interesting idea.  Unfortunately it didn't work.

But thanks for the suggestion.
Duncan



Thu, 30 Dec 2004 00:04:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need help with picturebox palette!!!

2. BLTing a PictureBox then SavePicture, wrong palette

3. Palette property non-existent with PictureBox ?

4. Picturebox Palette?

5. VB5 Palettes, how to access a PictureBox hPal?

6. Palette in a PictureBox

7. Here's a palette / drop to do change the background

8. Screen 9 palette changing

9. Asic palette change

10. Need help changing palette in an enhanced metafile

11. Change Screen Color Palette from 256 to hi-color in VB

12. BitBlt Changes Palette? Need Help

 

 
Powered by phpBB® Forum Software