RGBSurface.Transform
From Xojo Documentation
Method
Method
RGBSurface.Transform(RedMap() as Double,GreenMap() as Double,BlueMap() as Double)
New in 5.5
Supported for all project types and targets.
New in 5.5
Supported for all project types and targets.
Applies a one-to-one pixel transformation to all pixels of an RGBSurface.
Transform is overloaded. You can specify the transformation via either of three lookup tables, RedMap, GreenMap, and BlueMap, or one lookup table to apply to all three channels.
Each map parameter is an 256 element array of integers. The transformation works as follows: For each pixel, the pixel's RGB value is used as an index into the map arrays and the value found becomes the new R, G, or B value for the pixel.
For example, if you set up a map such that map(i)=255-i, then calling Transform(Map) will invert the image.
Example
The following example uses the Transform method to invert an image: