Marblecore Imaging Library Documentation

Documentation Introduction
Documentation / Marblecore Imaging / Methods / DrawPolygonGradient

DrawPolygonGradient method

Draws a gradient filled polygon on the specified position on the image using the specified color, style and opacity.

Syntax

Boolean DrawPolygonGradient(strPoints As String, nColorA As Number, nColorB As Number, nOpacityA As Number, nOpacityB As Number, nGradient As Gradient, bAntiAliasing As Boolean)

Return value

Returns true if the function succeeded.

Parameters

ParameterTypeRequiredDescription
strPointsStringYesSpecifies the points for the polygon as a string. Each point pair is separated with a semicollon (;). Within each point the horizontal and vertical coordinate is separated with a comma (,). Example string: 0,100; 25,50; 50,0; 100,100.
nColorANumberYesSpecifies the first color for the gradient.
nColorBNumberYesSpecifies the second color for the gradient.
nOpacityANumberNoOptional parameter containing the opacity percentage (where 0% is completely transparent) for the first color.
nOpacityBNumberNoOptional parameter containing the opacity percentage (where 0% is completely transparent) for the second color.
nGradientGradient (Enumeration)NoOptional parameter containing the gradient style. Can be one of the following values:
bAntiAliasingBooleanNoOptional parameter enabling or disabling anti-aliasing. Enabled by default.

Example

The example below shows how to use the method. If you take a look at the example code, assume there is a reference to the Marblecore Imaging object with the name 'MarblecoreImaging'. Transparent parts of the image are displayed using a checkerboard pattern.
 
 
1 // Creates a new transparent image
2 MarblecoreImaging.Create(150, 150, true);
3 
4 // Execute the operation
5 MarblecoreImaging.DrawPolygonGradient("25,75; 75,25; 125,125", 16711680, 65280);
6 
7 // Save the modified image to the specified file
8 MarblecoreImaging.SaveToFile("example-drawpolygongradient.jpg");

Category

Drawing

See also

DrawArc | DrawArrow | DrawBackground | DrawBezier | DrawCheckerboard | DrawCurve | DrawCurveBorder | DrawCurveFilled | DrawCurveGradient | DrawEllipse | DrawEllipseBorder | DrawEllipseFilled | DrawEllipseGradient | DrawFloodFill | DrawLine | DrawPie | DrawPieBorder | DrawPieFilled | DrawPieGradient | DrawPixel | DrawPolygon | DrawPolygonBorder | DrawPolygonFilled | DrawRectangle | DrawRectangleBorder | DrawRectangleFilled | DrawRectangleGradient | DrawRectangleTransparent | DrawRhombus | DrawRhombusBorder | DrawRhombusFilled | DrawRhombusGradient | DrawRoundRectangle | DrawRoundRectangleBorder | DrawRoundRectangleFilled | DrawRoundRectangleGradient | DrawTriangle | DrawTriangleBorder | DrawTriangleFilled | DrawTriangleGradient | GetPixelColor | LineTo | MoveTo