GdPicture image identifier. Specifies the image to be drawn from.
GdPicture image identifier. specifies the image to draw to.
The color to set as transparent. A suitable color value can be obtained by using the ARGB() method.
Percentage threshold between 0 and 100.
Specifies the x-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
Specifies the y-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
Specifies the width, in pixels, of the destination rectangle at which to draw the image.
Specifies the height, in pixels, of the destination rectangle at which to draw the image.
A member of the Drawing2D.InterpolationMode enumeration.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / DrawGdPictureImageTransparencyColor Method / DrawGdPictureImageTransparencyColor(Int32,Int32,Color,Single,Int32,Int32,Int32,Int32,InterpolationMode) Method

DrawGdPictureImageTransparencyColor(Int32,Int32,Color,Single,Int32,Int32,Int32,Int32,InterpolationMode) Method

In This Topic
Draws a GdPicture image into another GdPicture image setting a specific color of the image to draw as transparent. This method takes a percentage threshold parameter regarding the color to set as transparent. Ie: A threshold value of 90 means that all the color values which are within 90% of the color value parameter will be set as transparent.
Syntax
'Declaration
 
Public Overloads Function DrawGdPictureImageTransparencyColor( _
   ByVal SrcImage As Integer, _
   ByVal DstImage As Integer, _
   ByVal TransparentColor As Color, _
   ByVal Threshold As Single, _
   ByVal DstLeft As Integer, _
   ByVal DstTop As Integer, _
   ByVal DstWidth As Integer, _
   ByVal DstHeight As Integer, _
   ByVal InterpolationMode As InterpolationMode _
) As GdPictureStatus
public GdPictureStatus DrawGdPictureImageTransparencyColor( 
   int SrcImage,
   int DstImage,
   Color TransparentColor,
   float Threshold,
   int DstLeft,
   int DstTop,
   int DstWidth,
   int DstHeight,
   InterpolationMode InterpolationMode
)
public function DrawGdPictureImageTransparencyColor( 
    SrcImage: Integer;
    DstImage: Integer;
    TransparentColor: Color;
    Threshold: Single;
    DstLeft: Integer;
    DstTop: Integer;
    DstWidth: Integer;
    DstHeight: Integer;
    InterpolationMode: InterpolationMode
): GdPictureStatus; 
public function DrawGdPictureImageTransparencyColor( 
   SrcImage : int,
   DstImage : int,
   TransparentColor : Color,
   Threshold : float,
   DstLeft : int,
   DstTop : int,
   DstWidth : int,
   DstHeight : int,
   InterpolationMode : InterpolationMode
) : GdPictureStatus;
public: GdPictureStatus DrawGdPictureImageTransparencyColor( 
   int SrcImage,
   int DstImage,
   Color TransparentColor,
   float Threshold,
   int DstLeft,
   int DstTop,
   int DstWidth,
   int DstHeight,
   InterpolationMode InterpolationMode
) 
public:
GdPictureStatus DrawGdPictureImageTransparencyColor( 
   int SrcImage,
   int DstImage,
   Color TransparentColor,
   float Threshold,
   int DstLeft,
   int DstTop,
   int DstWidth,
   int DstHeight,
   InterpolationMode InterpolationMode
) 

Parameters

SrcImage
GdPicture image identifier. Specifies the image to be drawn from.
DstImage
GdPicture image identifier. specifies the image to draw to.
TransparentColor
The color to set as transparent. A suitable color value can be obtained by using the ARGB() method.
Threshold
Percentage threshold between 0 and 100.
DstLeft
Specifies the x-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
DstTop
Specifies the y-coordinate in pixels of the upper-left corner of the destination rectangle at which to draw the image.
DstWidth
Specifies the width, in pixels, of the destination rectangle at which to draw the image.
DstHeight
Specifies the height, in pixels, of the destination rectangle at which to draw the image.
InterpolationMode
A member of the Drawing2D.InterpolationMode enumeration.

Return Value

A member of the GdPictureStatus enumeration.
Example
Rendering an image with the circle into the background image, with a blue color set as transparent. The result is saved into a PNG file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Create background image
    int backImage = gdpictureImaging.CreateNewGdPictureImage(320, 200, 32, Color.Green);
 
    // Create image with blue background, and draw red circle in it
    int circleImage = gdpictureImaging.CreateNewGdPictureImage(80, 80, 32, Color.Blue);
    gdpictureImaging.DrawFilledCircle(circleImage, 40, 40, 60, Color.Red, false);
 
    // Draw image with circle into the background image. Blue color will be omited.
    gdpictureImaging.DrawGdPictureImageTransparencyColor(circleImage, backImage, Color.Blue, 90f, 0, 0, 80, 80, System.Drawing.Drawing2D.InterpolationMode.Default);
    gdpictureImaging.SaveAsPNG(backImage, "output.png");
 
    // Release used resources
    gdpictureImaging.ReleaseGdPictureImage(circleImage);
    gdpictureImaging.ReleaseGdPictureImage(backImage);
}
See Also