GdPicture.NET Reference Guide
ARGB(Byte,Byte,Byte) Method
Example 





GdPicture14 Namespace > GdPictureImaging Class > ARGB Method : ARGB(Byte,Byte,Byte) Method
The value for the red component. Use the value between 0 and 255.
The value for the green component. Use the value between 0 and 255.
The value for the blue component. Use the value between 0 and 255.
Returns a Color object, that represents a color composed from a specified set of red, green and blue color components.
Syntax
'Declaration
 
Public Overloads Function ARGB( _
   ByVal Red As Byte, _
   ByVal Green As Byte, _
   ByVal Blue As Byte _
) As Color
public Color ARGB( 
   byte Red,
   byte Green,
   byte Blue
)
public function ARGB( 
    Red: Byte;
    Green: Byte;
    Blue: Byte
): Color; 
public function ARGB( 
   Red : byte,
   Green : byte,
   Blue : byte
) : Color;
public: Color ARGB( 
   byte Red,
   byte Green,
   byte Blue
) 
public:
Color ARGB( 
   byte Red,
   byte Green,
   byte Blue
) 

Parameters

Red
The value for the red component. Use the value between 0 and 255.
Green
The value for the green component. Use the value between 0 and 255.
Blue
The value for the blue component. Use the value between 0 and 255.

Return Value

A Color object representing a required color.
Example
How to get the proper color using this method for swapping red color with green color.
Dim caption As String = "Example: ARGB"
Using oImage As GdPictureImaging = New GdPictureImaging()
    Dim imageID As Integer = oImage.CreateGdPictureImageFromFile("input.png")
    If oImage.GetStat() = GdPictureStatus.OK Then
        If oImage.SwapColor(imageID, oImage.ARGB(255, 0, 0), oImage.ARGB(0, 255, 0)) = GdPictureStatus.OK Then
            If oImage.SaveAsPNG(imageID, "output.png") = GdPictureStatus.OK Then
                MessageBox.Show("The image has been saved successfully.", caption)
            Else
                MessageBox.Show("The image can't be saved. Status: " + oImage.GetStat().ToString(), caption)
            End If
        Else
            MessageBox.Show("The image can't be painted. Status: " + oImage.GetStat().ToString(), caption)
        End If
        oImage.ReleaseGdPictureImage(imageID)
    Else
        MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption)
    End If
End Using
string caption = "Example: ARGB";
using (GdPictureImaging oImage = new GdPictureImaging())
{
    int imageID = oImage.CreateGdPictureImageFromFile("input.png");
    if (oImage.GetStat() == GdPictureStatus.OK)
    {
        if (oImage.SwapColor(imageID, oImage.ARGB(255, 0, 0), oImage.ARGB(0, 255, 0)) == GdPictureStatus.OK)
        {
            if (oImage.SaveAsPNG(imageID, "output.png") == GdPictureStatus.OK)
                MessageBox.Show("The image has been saved successfully.", caption);
            else
                MessageBox.Show("The image can't be saved. Status: " + oImage.GetStat().ToString(), caption);
        }
        else
            MessageBox.Show("The image can't be painted. Status: " + oImage.GetStat().ToString(), caption);
        oImage.ReleaseGdPictureImage(imageID);
    }
    else
        MessageBox.Show("The image can't be created. Status: " + oImage.GetStat().ToString(), caption);
}
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
Overload List
ARGBI Method
SwapColor(Integer, Color, Color)