DrawRotatedRectangle(Int32,Single,Single,Single,Single,Single,Int32,Int32,Boolean) Method
In This Topic
Draws a rotated rectangle on a GdPicture image. The drawing color is specified with an integer value.
Syntax
'Declaration
Public Overloads Function DrawRotatedRectangle( _
ByVal As Integer, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single, _
ByVal As Integer, _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
public GdPictureStatus DrawRotatedRectangle(
int ,
float ,
float ,
float ,
float ,
float ,
int ,
int ,
bool
)
public function DrawRotatedRectangle(
: Integer;
: Single;
: Single;
: Single;
: Single;
: Single;
: Integer;
: Integer;
: Boolean
): GdPictureStatus;
public function DrawRotatedRectangle(
: int,
: float,
: float,
: float,
: float,
: float,
: int,
: int,
: boolean
) : GdPictureStatus;
public: GdPictureStatus DrawRotatedRectangle(
int ,
float ,
float ,
float ,
float ,
float ,
int ,
int ,
bool
)
public:
GdPictureStatus DrawRotatedRectangle(
int ,
float ,
float ,
float ,
float ,
float ,
int ,
int ,
bool
)
Parameters
- ImageID
- GdPicture image identifier.
- Angle
- Angle of rotation in degrees.
- DstLeft
- Specifies the x-coordinate of the upper-left corner of the rectangle.
- DstTop
- Specifies the y-coordinate of the upper-left corner of the rectangle.
- Width
- Specifies the width of the rectangle.
- Height
- Specifies the height of the rectangle.
- PenWidth
- Width, in pixel, of the pen used to draw the rectangle.
- PenColor
- Color of the rectangle. A suitable color value can be obtained by using the ARGBI() method.
- AntiAlias
- Set to True to apply the Antialiasing algorithm else False.
Return Value
A member of the GdPictureStatus enumeration.
Example
Drawing a rotated rectangle on a GdPicture image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int left = 50, top = 100, width = 250, height = 150;
float angle = 30.0f;
int penWidth = 20;
Color penColor = gdpictureImaging.ARGBI(255, 0, 0, 255);
int imageID = gdpictureImaging.CreateNewGdPictureImage(400, 400, System.Drawing.Imaging.PixelFormat.Format24bppRgb, gdpictureImaging.ARGBI(0, 0, 0, 0));
// Draw the rotated rectangle. The AntiAlias parameter is set to true to apply antialiasing algorithm, i.e. to improve the appearance of the rectangle boundary.
gdpictureImaging.DrawRotatedRectangle(imageID, angle, left, top, width, height, penWidth, penColor, true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Example
Drawing a rotated rectangle on a GdPicture image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int left = 50, top = 100, width = 250, height = 150;
float angle = 30.0f;
int penWidth = 20;
Color penColor = gdpictureImaging.ARGBI(255, 0, 0, 255);
int imageID = gdpictureImaging.CreateNewGdPictureImage(400, 400, System.Drawing.Imaging.PixelFormat.Format24bppRgb, gdpictureImaging.ARGBI(0, 0, 0, 0));
// Draw the rotated rectangle. The AntiAlias parameter is set to true to apply antialiasing algorithm, i.e. to improve the appearance of the rectangle boundary.
gdpictureImaging.DrawRotatedRectangle(imageID, angle, left, top, width, height, penWidth, penColor, true);
gdpictureImaging.SaveAsPNG(imageID, "output.png");
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also