Author Topic: Palettes  (Read 611 times)

dinalt2006

  • Guest
Palettes
« on: 19 April 2010, 07:42:46 »
I need examples for manipulating palettes of image. I wanna to create standert palette and use it for current image...

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 312
    • View Profile
    • Galfar's Homepage
Re: Palettes
« Reply #1 on: 20 April 2010, 15:29:17 »
You can create new palette using NewPalette function in Imaging.pas (check out other palette functions there like CopyPalette, FindColor, FillCustomPalette, etc.).

After call to NewPalette you can modify palette entries easily, it's just array of RGBA values (Pal[10].R := 255).

Existing image can be mapped to palette using MapImageToPalette function.