Marblecore Imaging Library Documentation

Documentation Introduction
Documentation / Marblecore Imaging / Methods / DrawPixel

DrawPixel method

Draws a pixel on the specified position on the image using the specified color and opacity and using interpolation.

Syntax

Boolean DrawPixel(nLeft As Number, nTop As Number, nPenColor As Number, nPenOpacity As Number)

Return value

Returns true if the function succeeded.

Parameters

ParameterTypeRequiredDescription
nLeftNumberYesSpecifies the horizontal coordinate of the pixel.
nTopNumberYesSpecifies the vertical coordinate of the pixel.
nPenColorNumberNoOptional parameter containing a color value. If no color is specified, the current pen color will be used instead.
nPenOpacityNumberNoOptional parameter containing the opacity percentage (where 0% is completely transparent). If no opacity is specified, the current pen opacity will be used instead.

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.DrawPixel(75, 75);
6 
7 // Save the modified image to the specified file
8 MarblecoreImaging.SaveToFile("example-drawpixel.jpg");

Category

Drawing

See also

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