GdPicture.NET Reference Guide
GifSetTransparency Method
Example 





GdPicture14 Namespace > GdPictureImaging Class : GifSetTransparency Method
GdPicture Image Identifier.
Color to set as transparent. A suitable color value can be obtained by using the ARGB() method.
Sets the transparency color for a Gif GdPicture image. If the specified GdPicture image is an editable multiframe gif image, you should use this method for each frame of the image.
Syntax
'Declaration
 
Public Function GifSetTransparency( _
   ByVal ImageID As Integer, _
   ByVal TransparentColor As Color _
) As GdPictureStatus
public GdPictureStatus GifSetTransparency( 
   int ImageID,
   Color TransparentColor
)
public function GifSetTransparency( 
    ImageID: Integer;
    TransparentColor: Color
): GdPictureStatus; 
public function GifSetTransparency( 
   ImageID : int,
   TransparentColor : Color
) : GdPictureStatus;
public: GdPictureStatus GifSetTransparency( 
   int ImageID,
   Color TransparentColor
) 
public:
GdPictureStatus GifSetTransparency( 
   int ImageID,
   Color TransparentColor
) 

Parameters

ImageID
GdPicture Image Identifier.
TransparentColor
Color to set as transparent. A suitable color value can be obtained by using the ARGB() method.

Return Value

A member of the GdPictureStatus enumeration.
Example
Setting the transparency of a gif image.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.gif")
If imageId <> 0 Then
   oGdPictureImaging.GifSetTransparency(ImageID, oGdPictureImaging.ARGB(255, 0, 255, 0))
   oGdPictureImaging.SaveAsGIF (ImageID, "output.gif")
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
ARGB(Byte,Byte,Byte) Method