WinXDraw_SetImageChannel


WinXDraw_SetImageChannel (hImage, channel, UBYTE @data[])

Sets the image channel data for an image channel

Parameter Description
hImage The handle to the image to set the channel for
channel The channel id, see remarks for more info
UBYTE @data[] The channel data. The function fails if this array is too small

Returns

$$TRUE on success or $$FALSE on fail

Remarks

The channel parameter can be any one of :

$$CHANNEL_RED
The red channel
$$CHANNEL_GREEN
The green channel
$$CHANNEL_BLUE
The blue channel
$$CHANNEL_ALPHA
The alpha (transparency) channel

Note that the data[] array is single dimensional, in row order, and with the last scanline at the top of the array. This orgainisation is a little wierd. It is to do with the way Windows stores and renders bitmaps.

Examples

'Declare the data array
UBYTE data[]

...

'Set the red channel to 0 for a 400x300 bitmap
DIM data[400*300-1]
WinXDraw_SetImageChannel (hImage, $$CHANNEL_RED, @data[])

Related Links

Images
WinXDrawImage
WinXDraw_CreateImage
WinXDraw_LoadImage
WinXDraw_SaveImage
WinXDraw_SetImagePixel
WinXDraw_SetConstantAlpha
WinXDraw_GetImageInfo
WinXDraw_PremultiplyImage