Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / DrawGradientLine Method / DrawGradientLine(Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Boolean) Method
GdPicture image identifier.
Specifies the x-coordinate of the starting point of the line.
Specifies the y-coordinate of the starting point of the line.
Specifies the x-coordinate of the ending point of the line.
Specifies the y-coordinate of the ending point of the line.
The width, in pixel, of the pen used to draw the line.
Starting color of the gradient line, as integer value. A suitable color value can be obtained by using the ARGBI() method.
Ending color of the gradient line, as integer value. A suitable color value can be obtained by using the ARGBI() method.
Set to True to apply the Antialiasing algorithm else False.
Example





In This Topic
    DrawGradientLine(Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Boolean) Method
    In This Topic
    Draws a linear gradient line on a GdPicture image.
    Syntax
    'Declaration
     
    
    Public Overloads Function DrawGradientLine( _
       ByVal ImageID As Integer, _
       ByVal SrcLeft As Integer, _
       ByVal SrcTop As Integer, _
       ByVal DstLeft As Integer, _
       ByVal DstTop As Integer, _
       ByVal PenWidth As Integer, _
       ByVal StartColor As Integer, _
       ByVal EndColor As Integer, _
       ByVal AntiAlias As Boolean _
    ) As GdPictureStatus
    public GdPictureStatus DrawGradientLine( 
       int ImageID,
       int SrcLeft,
       int SrcTop,
       int DstLeft,
       int DstTop,
       int PenWidth,
       int StartColor,
       int EndColor,
       bool AntiAlias
    )
    public function DrawGradientLine( 
        ImageID: Integer;
        SrcLeft: Integer;
        SrcTop: Integer;
        DstLeft: Integer;
        DstTop: Integer;
        PenWidth: Integer;
        StartColor: Integer;
        EndColor: Integer;
        AntiAlias: Boolean
    ): GdPictureStatus; 
    public function DrawGradientLine( 
       ImageID : int,
       SrcLeft : int,
       SrcTop : int,
       DstLeft : int,
       DstTop : int,
       PenWidth : int,
       StartColor : int,
       EndColor : int,
       AntiAlias : boolean
    ) : GdPictureStatus;
    public: GdPictureStatus DrawGradientLine( 
       int ImageID,
       int SrcLeft,
       int SrcTop,
       int DstLeft,
       int DstTop,
       int PenWidth,
       int StartColor,
       int EndColor,
       bool AntiAlias
    ) 
    public:
    GdPictureStatus DrawGradientLine( 
       int ImageID,
       int SrcLeft,
       int SrcTop,
       int DstLeft,
       int DstTop,
       int PenWidth,
       int StartColor,
       int EndColor,
       bool AntiAlias
    ) 

    Parameters

    ImageID
    GdPicture image identifier.
    SrcLeft
    Specifies the x-coordinate of the starting point of the line.
    SrcTop
    Specifies the y-coordinate of the starting point of the line.
    DstLeft
    Specifies the x-coordinate of the ending point of the line.
    DstTop
    Specifies the y-coordinate of the ending point of the line.
    PenWidth
    The width, in pixel, of the pen used to draw the line.
    StartColor
    Starting color of the gradient line, as integer value. A suitable color value can be obtained by using the ARGBI() method.
    EndColor
    Ending color of the gradient line, as integer value. 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 linear gradient line on a GdPicture image.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int startLeft = 10, startTop = 20, endLeft = 200, endTop = 150;
        int penWidth = 15;
        Color startColor = gdpictureImaging.ARGBI(255, 0, 0, 255), endColor = gdpictureImaging.ARGBI(255, 255, 255, 0);
        int imageID = gdpictureImaging.CreateNewGdPictureImage(400, 400, System.Drawing.Imaging.PixelFormat.Format24bppRgb, gdpictureImaging.ARGBI(0, 0, 0, 0));
     
        // Draw gradient line. The AntiAlias parameter is set to true to apply antialiasing algorithm, i.e. to improve the appearance of the line boundary.
        gdpictureImaging.DrawGradientLine(imageID, startLeft, startTop, endLeft, endTop, penWidth, startColor, endColor, true);
     
        gdpictureImaging.SaveAsPNG(imageID, "output.png");
     
        // Release used resources.
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also