Documentation / Marblecore Imaging / Methods / DrawRectangleTransparent
DrawRectangleTransparent method
Draws a gradient filled rectangle on the specified position with the specified width and height.
Syntax
Boolean DrawRectangleTransparent(nLeft As Number, nTop As Number, nWidth As Number, nHeight As Number, nOpacityBegin As Number, nOpacityEnd As Number, nGradient As Gradient, nBackgroundColor As Number, nBackgroundOpacity As Number)
Return value
Returns true if the function succeeded.
Parameters
Parameter | Type | Required | Description |
nLeft | Number | Yes | Specifies the horizontal coordinate. |
nTop | Number | Yes | Specifies the vertical coordinate. |
nWidth | Number | Yes | Specifies the width. |
nHeight | Number | Yes | Specifies the height. |
nOpacityBegin | Number | No | Optional parameter containing the begin opacity percentage (where 0% is completely transparent). |
nOpacityEnd | Number | No | Optional parameter containing the end opacity percentage (where 0% is completely transparent). |
nGradient | Gradient (Enumeration) | No | Optional parameter containing the gradient style. |
nBackgroundColor | Number | No | Optional parameter which specifies the background color. If omitted, the default background color will be used. |
nBackgroundOpacity | Number | No | Optional parameter which specifies the opacity of the background color. |
Example
The example below shows the effect of this method and how to use it. You can slide the marker in the before/after picture to see the difference. 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
2 MarblecoreImaging.Create(150, 150, true);
3
4
5 MarblecoreImaging.DrawRectangleTransparent(25, 25, 100, 100, 0, 100, "Vertical");
6
7
8 MarblecoreImaging.SaveToFile("example-drawrectangletransparent-after.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 |
DrawPolygonGradient |
DrawRectangle |
DrawRectangleBorder |
DrawRectangleFilled |
DrawRectangleGradient |
DrawRhombus |
DrawRhombusBorder |
DrawRhombusFilled |
DrawRhombusGradient |
DrawRoundRectangle |
DrawRoundRectangleBorder |
DrawRoundRectangleFilled |
DrawRoundRectangleGradient |
DrawTriangle |
DrawTriangleBorder |
DrawTriangleFilled |
DrawTriangleGradient |
GetPixelColor |
LineTo |
MoveTo