ARGBI Method (GdPictureImaging)
In This Topic
Returns a 32-bit value, that represents a color composed from a specified set of alpha, red, green and blue color components.
Syntax
'Declaration
Public Function ARGBI( _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte _
) As Integer
public int ARGBI(
byte ,
byte ,
byte ,
byte
)
public function ARGBI(
: Byte;
: Byte;
: Byte;
: Byte
): Integer;
public function ARGBI(
: byte,
: byte,
: byte,
: byte
) : int;
public: int ARGBI(
byte ,
byte ,
byte ,
byte
)
public:
int ARGBI(
byte ,
byte ,
byte ,
byte
)
Parameters
- Alpha
- The value for the alpha component also known as a transparency. Use the value between 0 (full transparency) and 255 (full opacity).
- 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 32-bit value representing a required color.
Example
Rendering an image with a circle onto the background image and saving the result into a png file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int backColor = gdpictureImaging.ARGBI(255, 0, 255, 0); // Green color
int circleColor = gdpictureImaging.ARGBI(255, 255, 0, 0); // Red color
// Create a background image.
int backImage = gdpictureImaging.CreateNewGdPictureImage(320, 200, 32, backColor);
// Create an image used for drawing, and draw a circle on it.
int circleImage = gdpictureImaging.CreateNewGdPictureImage(80, 80, 32, gdpictureImaging.ARGBI(0, 0, 0, 0));
gdpictureImaging.DrawFilledCircle(circleImage, 40, 40, 60, circleColor, false);
// Draw an image with a circle onto the background image.
gdpictureImaging.DrawGdPictureImage(circleImage, backImage, 0, 0, 80, 80, System.Drawing.Drawing2D.InterpolationMode.Default);
gdpictureImaging.SaveAsPNG(backImage, "output.png");
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(circleImage);
gdpictureImaging.ReleaseGdPictureImage(backImage);
}
Example
Rendering an image with a circle onto the background image and saving the result into a png file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int backColor = gdpictureImaging.ARGBI(255, 0, 255, 0); // Green color
int circleColor = gdpictureImaging.ARGBI(255, 255, 0, 0); // Red color
// Create a background image.
int backImage = gdpictureImaging.CreateNewGdPictureImage(320, 200, 32, backColor);
// Create an image used for drawing, and draw a circle on it.
int circleImage = gdpictureImaging.CreateNewGdPictureImage(80, 80, 32, gdpictureImaging.ARGBI(0, 0, 0, 0));
gdpictureImaging.DrawFilledCircle(circleImage, 40, 40, 60, circleColor, false);
// Draw an image with a circle onto the background image.
gdpictureImaging.DrawGdPictureImage(circleImage, backImage, 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