GdPicture.NET Reference Guide
ColorCMYKtoRGB Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ColorCMYKtoRGB Method
The input value for the Cyan component. Use the value between 0 and 255.
The input value for the Magenta component. Use the value between 0 and 255.
The input value for the Yellow component. Use the value between 0 and 255.
The input value for the Black (Key) component. Use the value between 0 and 255.
Output parameter. The resulting value for the red component between 0 and 255.
Output parameter. The resulting value for the green component between 0 and 255.
Output parameter. The resulting value for the blue component between 0 and 255.
Converts the required CMYK color, which is composed of a set of specified Cyan, Magenta, Yellow and Black (Key) color components to the RGB color composed of a set of resulting red, green, and blue components.
Syntax
'Declaration
 
Public Sub ColorCMYKtoRGB( _
   ByVal Cyan As Integer, _
   ByVal Magenta As Integer, _
   ByVal Yellow As Integer, _
   ByVal Black As Integer, _
   ByRef Red As Integer, _
   ByRef Green As Integer, _
   ByRef Blue As Integer _
) 
public void ColorCMYKtoRGB( 
   int Cyan,
   int Magenta,
   int Yellow,
   int Black,
   ref int Red,
   ref int Green,
   ref int Blue
)
public procedure ColorCMYKtoRGB( 
    Cyan: Integer;
    Magenta: Integer;
    Yellow: Integer;
    Black: Integer;
   var  Red: Integer;
   var  Green: Integer;
   var  Blue: Integer
); 
public function ColorCMYKtoRGB( 
   Cyan : int,
   Magenta : int,
   Yellow : int,
   Black : int,
   Red : int,
   Green : int,
   Blue : int
);
public: void ColorCMYKtoRGB( 
   int Cyan,
   int Magenta,
   int Yellow,
   int Black,
   ref int Red,
   ref int Green,
   ref int Blue
) 
public:
void ColorCMYKtoRGB( 
   int Cyan,
   int Magenta,
   int Yellow,
   int Black,
   int% Red,
   int% Green,
   int% Blue
) 

Parameters

Cyan
The input value for the Cyan component. Use the value between 0 and 255.
Magenta
The input value for the Magenta component. Use the value between 0 and 255.
Yellow
The input value for the Yellow component. Use the value between 0 and 255.
Black
The input value for the Black (Key) component. Use the value between 0 and 255.
Red
Output parameter. The resulting value for the red component between 0 and 255.
Green
Output parameter. The resulting value for the green component between 0 and 255.
Blue
Output parameter. The resulting value for the blue component between 0 and 255.
Example
How to convert the CMYK color to the RGB color for further use.
Dim caption As String = "Example: ColorCMYKtoRGB"
Using oImage As GdPictureImaging = New GdPictureImaging()
    Dim imageID As Integer = oImage.CreateGdPictureImageFromFile("")
    If oImage.GetStat() = GdPictureStatus.OK Then
        Dim red As Integer = 0, green As Integer = 0, blue As Integer = 0
        oImage.ColorCMYKtoRGB(255, 0, 128, 0, red, green, blue)
        If (oImage.ClearImage(imageID, oImage.ARGB(255, CByte(red), CByte(green), CByte(blue))) = GdPictureStatus.OK) AndAlso
           (oImage.SaveAsPNG(imageID, "output.png") = GdPictureStatus.OK) Then
            MessageBox.Show("The image has been saved successfully.", caption)
        Else
            MessageBox.Show("An error occurred when processing the image. 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: ColorCMYKtoRGB";
using (GdPictureImaging oImage = new GdPictureImaging())
{
    int imageID = oImage.CreateGdPictureImageFromFile("");
    if (oImage.GetStat() == GdPictureStatus.OK)
    {
        int red = 0, green = 0, blue = 0;
        oImage.ColorCMYKtoRGB(255, 0, 128, 0, ref red, ref green, ref blue);
        if ((oImage.ClearImage(imageID, oImage.ARGB(255, (byte)red, (byte)green, (byte)blue)) == GdPictureStatus.OK) &&
            (oImage.SaveAsPNG(imageID, "output.png") == GdPictureStatus.OK))
            MessageBox.Show("The image has been saved successfully.", caption);
        else
            MessageBox.Show("An error occurred when processing the image. 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
ColorCMYtoRGB Method
ColorRGBtoCMYK Method
ColorRGBtoCMY Method