GdPicture image identifier.
Array which specifies the color remap table. Each entry is a Imaging.ColorMap oGdPictureImaging.
Example





In This Topic

SetColorRemap Method

In This Topic
Applies a color-remap table to a GdPicture image.
Syntax
'Declaration

 

Public Function SetColorRemap( _

   ByVal ImageID As Integer, _

   ByVal RemapTable() As ColorMap _

) As GdPictureStatus
public GdPictureStatus SetColorRemap( 

   int ImageID,

   ColorMap[] RemapTable

)
public function SetColorRemap( 

    ImageID: Integer;

    RemapTable: ColorMaparray of

): GdPictureStatus; 
public function SetColorRemap( 

   ImageID : int,

   RemapTable : ColorMap[]

) : GdPictureStatus;
public: GdPictureStatus SetColorRemap( 

   int ImageID,

   ColorMap*[]* RemapTable

) 
public:

GdPictureStatus SetColorRemap( 

   int ImageID,

   array<ColorMap^>^ RemapTable

) 

Parameters

ImageID
GdPicture image identifier.
RemapTable
Array which specifies the color remap table. Each entry is a Imaging.ColorMap oGdPictureImaging.

Return Value

A member of the GdPictureStatus enumeration.
Remarks

This method requires the Image Documents component to run.

Example
Replacing shades of red by shades of blue within a an image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())

{

    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.bmp");

 

    // Create the table.

    System.Drawing.Imaging.ColorMap[] RemapTable = new System.Drawing.Imaging.ColorMap[256];

    for (int index = 0; index < 256; index++)

    {

        System.Drawing.Imaging.ColorMap remap = new System.Drawing.Imaging.ColorMap();

        remap.NewColor = Color.FromArgb(0, 0, index);

        remap.OldColor = Color.FromArgb(index, 0, 0);

        RemapTable[index] = remap;

    }

 

    // Apply the table.

    gdpictureImaging.SetColorRemap(imageID, RemapTable);

    gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);

    gdpictureImaging.ReleaseGdPictureImage(imageID);

}
See Also