|www.progui.co.uk Top Previous Next|
*newImage = ImgBlend(*SourceImage, AlphaChannel.f, Contrast.f, Brightness.f, BlendColor.l, BlendAmount.f, Flags.i)
ImgBlend is a powerful and versatile image effect command for creating a new image/icon based on altering a source icon or image's alpha channel, contrast, brightness and/or blend with another colour. A common use for this command is automatically generating images for hot and disabled states (based on one stored image) for use in other ProGUI commands.
*SourceImage is a pointer to the icon/image that you wish to manipulate. AlphaChannel.f specifies the new transparency level (also taking into account the existing alpha channel data) and can be in the range of 0 to 255 (0 = fully transparent, 255 = solid). Contrast.f specifies the new contrast level and can be in the range of -255 to 255, this parameter can also be Null (having no effect on contrast). Brightness.f specifies the new brightness level and can be in the range of -255 to 255, this parameter can also be Null (having no effect on brightness). BlendColor.l specifies an RGB colour value that will be used with BlendAmount.f (0 to 255) in order to blend the new image to that colour, BlendColor.l and BlendAmount.f can both be Null in order to have no effect. Flags.i can contain the following constants: -
#ImgBlend_Greyscale Converts the image to grey scale, taking effect before any of the other image effects are added (if any).
#ImgBlend_ReturnIcon Returns an Icon (HICON) as *newImage instead of an image (HBITMAP).
#ImgBlend_DestroyOriginal Destroys the original *SourceImage.
Returns a pointer to the new image/icon or zero for failure.
The returned *newImage can later be destroyed when not needed anymore by using the FreeImg command.