|
PaletteMapRGBImage | |
ColourCount = PaletteMapRGBImage(ThisImage, Palette(), [ColourCount=0]) | |
Parameters: ThisImage = Index of image to convert RGB colours to Palette Indexes in Palette() = 1D array full of palette values (has to be at least 65536 in size) [ColourCount=0] = The number of colours in the palette. From 0 to colour Count |
|
Returns: ColourCount = The size of the colour palette. |
|
The PaletteMapRGBImage function converts a conventional RGB formatted image, into a palette mapped form. The function runs through the source image and works out all the unique RGB colours, once it's built the unique colour list, it replaces the original RGB formatted pixels with the 16Bit colour index values in the image. Any colours that aren't found the existing palette, are merged at the end of the user supplied palette array also. Internally the image you supply PaletteMapRGBImage gets converted to a 16bit FX image using CreateFxImageEx, so PlayBASIC's graphic engine thinks it's just a regular image. This means we can draw this image onto other images that are palette mapped with the same palette also, just like normal RGB images. However, if we try draw an RGB image to the Palette mapped one (or vice versa), we'll get mess. FACTS: * PaletteMapRGBImage creates 16bit FX image image maximum number of colours in the final palette * PaletteMapRGBImage colour index zero is assumed to be the transparent colour. * PaletteMapRGBImage can be used to create an custom image formats to the protect your programs media. |
|
Example Source: Download This Example
|
Related Info: | CreateFxImageEx : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |