Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
TransparentColor Property
See Also 
Leadtools Namespace > RasterImage Class : TransparentColor Property



Gets or sets the transparent color used when painting this image.

Syntax

Visual Basic (Declaration) 
Public Property TransparentColor As RasterColor
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim value As RasterColor
 
instance.TransparentColor = value
 
value = instance.TransparentColor
C# 
public RasterColor TransparentColor {get; set;}
C++/CLI 
public:
property RasterColor TransparentColor {
   RasterColor get();
   void set (RasterColor value);
}

Return Value

The transparent color used when painting this image.

Example

For an example, refer to GetTrueColorValue

Remarks

The TransparentColor of a RasterImage is used when the Transparent property value is set to true.

Note, transparent paint does not work with RasterPaintEngine.Gdi. For more information, refer to RasterPaintProperties.

If this RasterImage has a BitsPerPixel value of 8 or less, then the image has a palette. For palettized images, the value of the TransparentColor can be an RGB value or a palette index.

To set a palette index as the transparent color, use the RasterColor.FromPaletteIndex method.

If the color passed is a true RGB value(The value of see RasterColor.IsPaletteIndex is false and the image has a palette, then this RasterImage object will call GetTrueColorValue on the TransparentColor to translate it into the nearest palette index entry before using it to determine the actual transparent color in the image when painting.

For more information, refer to PNG Files and Transparency.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also