CreatePalette这个函数但是我弄了半天还没弄出来Dim x(450) As PALETTEENTRY
For i = LBound(C_Color) To UBound(C_Color) - 1
x(i).peRed = C_Color(i).r
x(i).peGreen = C_Color(i).b
x(i).peBlue = C_Color(i).b
Next
LogPal.palPalEntry = x
'Create the palette
hPal = CreatePalette(LogPal)
'PicAlde.BackColor = GetNearestColor(hPal, RGB(200, 200, 200))
main.PicAlde.BackColor = GetNearestPaletteIndex(hPal, RGB(255, 255, 255))
还有Public Type PALETTEENTRY
peRed As Byte
peGreen As Byte
peBlue As Byte
peFlags As Byte
End Type
Public Type LOGPALETTE
palVersion As Integer
palNumEntries As Integer
palPalEntry(450) As PALETTEENTRY
End Type
我主要是要实现用自己已知的450中RGB颜色来替换图片中的颜色。比如图片上有一个红色,我的450中颜色里面也有红色或者接近红色的颜色,那么把图片上面的颜色替换掉。
但是结果很不理想。要么是红色的要么是没反应这是奇怪了麻烦大家帮我看一下谢谢