Platforms to show: All Mac Windows Linux Cross-Platform

Back to GMGraphicsMBS class.

GMGraphicsMBS.Arc(startX as Double, startY as Double, endX as Double, endY as Double, startDegrees as Double, endDegrees as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw an arc using the stroke color and based on the circle starting at coordinates startX,startY, and ending with coordinates endX,endY, and bounded by the rotational arc startDegrees,endDegrees.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.type = image.TrueColorType
image.strokeColor = new GMColorRGBMBS("red") // Outline color
image.fillColor = new GMColorRGBMBS("green") // Fill color
image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.arc(250, 250, 100, 100,50,300)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.Bezier(values() as GMCoordinateMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw a bezier curve using the stroke color and based on the coordinates specified by the coordinates array.

GMGraphicsMBS.DashArray(values() as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify the pattern of dashes and gaps used to stroke paths.

The strokeDashArray represents a zero-terminated array of numbers that specify the lengths of alternating dashes and gaps in pixels. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. A typical strokeDashArray array might contain the members 5 3 2 0, where the zero value indicates the end of the pattern array.

GMGraphicsMBS.DashOffset(offset as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify the distance into the dash pattern to start the dash.

See documentation on SVG's stroke-dashoffset property for usage details.

GMGraphicsMBS.Draw

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draws all draw commands collected.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.type = image.TrueColorType
image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.DrawPath

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw on image using vector path.
Example
// new picture, 500x500 and filled with white
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)


Var draw as GMGraphicsMBS = image.Graphics

// Draw path

Var cr as new GMColorRGBMBS("red")
Var gr as new GMColorRGBMBS("green")
draw.StrokeColor cr
draw.FillColor gr
draw.PathMovetoAbs(30,10)
draw.PathLinetoAbs(20,55)
draw.PathLinetoAbs(70,50)
draw.PathLinetoAbs(80,5)
draw.DrawPath

draw.Draw

// show picture
image.type = image.TrueColorType // make sure it's a bitmap
Backdrop=image.CopyPicture

GMGraphicsMBS.Ellipse(originX as Double, originY as Double, perimX as Double, perimY as Double, arcStart as Double, arcEnd as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw an ellipse using the stroke color and thickness, specified origin, x & y radius, as well as specified start and end of arc in degrees.

If a fill color is specified, then the object is filled.

GMGraphicsMBS.FillColor(c as GMColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify drawing object fill color.

GMGraphicsMBS.FillOpacity(opacity as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify opacity to use when drawing using fill color.

GMGraphicsMBS.FillRule(fillRule as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify the algorithm which is to be used to determine what parts of the canvas are included inside the shape.

See documentation on SVG's fill-rule property for usage details.

GMGraphicsMBS.Font(fontname as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify font name to use when drawing text.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

Var draw as GMGraphicsMBS = image.Graphics

// draw red text
draw.strokeColor(new GMColorRGBMBS("red")) // Outline color
draw.strokeWidth(1)
draw.Font("/Library/Fonts/Verdana.ttf")
draw.Text(50, 50, "Hello", "")
draw.Draw

Backdrop=image.CopyPicture

See also:

GMGraphicsMBS.Font(fontname as string, StyleType as Integer, weight as Integer, StretchType as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the font.

Specify font family, style, weight (one of the set { 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 } with 400 being the normal size), and stretch to be used to select the font used when drawing text. Wildcard matches may be applied to style via the AnyStyle enumeration, applied to weight if weight is zero, and applied to stretch via the AnyStretch enumeration.

See also:

GMGraphicsMBS.Gravity(GravityType as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify text positioning gravity.

GMGraphicsMBS.Line(startX as Double, startY as Double, endX as Double, endY as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw a line using stroke color and thickness using starting and ending coordinates
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeColor = new GMColorRGBMBS("red") // Outline color
image.fillColor = new GMColorRGBMBS("green") // Fill color
image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

// Draw a line
draw.Line(100,100,400,400)
draw.Draw

image.type = image.TrueColorType
Backdrop=image.CopyPicture

GMGraphicsMBS.Matte(x as Double, y as Double, paintMethod as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Change the pixel matte value to transparent.

The point method changes the matte value of the target pixel. The replace method changes the matte value of any pixel that matches the color of the target pixel. Floodfill changes the matte value of any pixel that matches the color of the target pixel and is a neighbor, whereas filltoborder changes the matte value of any neighbor pixel that is not the border color, Finally reset changes the matte value of all pixels.

Paint methods:

PointMethod0Replace pixel color at point.
ReplaceMethod1Replace color for all image pixels matching color at point.
FloodfillMethod2Replace color for pixels surrounding point until encountering pixel that fails to match color at point.
FillToBorderMethod3Replace color for pixels surrounding point until encountering pixels matching border color.
ResetMethod4Replace colors for all pixels in image with pen color.

GMGraphicsMBS.MiterLimit(miterlimit as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify miter limit.

When two line segments meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of the line stroking the path. The miterLimit' imposes a limit on the ratio of the miter length to the 'lineWidth'. The default value of this parameter is 4.

GMGraphicsMBS.Rectangle(upperLeftX as Double, upperLeftY as Double, lowerRightX as Double, lowerRightY as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw a rectangle using stroke color and thickness from upper-left coordinates to lower-right coordinates.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeColor = new GMColorRGBMBS("red") // Outline color
image.fillColor = new GMColorRGBMBS("green") // Fill color
image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

// Draw a rectangle
draw.Rectangle(250, 250, 100, 100)
draw.Draw

Backdrop=image.CopyPicture

If a fill color is specified, then the object is filled.

GMGraphicsMBS.Rotation(angle as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Set rotation to use when drawing (coordinate transformation).
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.Rotation 5
draw.StrokeColor new GMColorRGBMBS("blue")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.RoundRectangle(centerX as Double, centerY as Double, width as Double, height as Double, cornerWidth as Double, cornerHeight as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw a rounded rectangle using stroke color and thickness, with specified center coordinate, specified width and height, and specified corner width and height.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeColor = new GMColorRGBMBS("red") // Outline color
image.fillColor = new GMColorRGBMBS("green") // Fill color
image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

// Draw a round rectangle
draw.RoundRectangle(250, 250, 100, 100,20,20)
draw.Draw

Backdrop=image.CopyPicture

If a fill color is specified, then the object is filled.

GMGraphicsMBS.Scaling(x as Double, y as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply scaling in x and y direction while drawing objects (coordinate transformation).
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics
draw.FillColor new GMColorRGBMBS("red")

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.StrokeColor new GMColorRGBMBS("blue")
draw.Scaling 1.2,1.1
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.SkewX(angle as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply Skew in X direction (coordinate transformation)
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.SkewX 5
draw.StrokeColor new GMColorRGBMBS("blue")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.SkewY(angle as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply Skew in Y direction.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.SkewY 5
draw.StrokeColor new GMColorRGBMBS("blue")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.StrokeAntialias(flag as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Antialias while drawing lines or object outlines.

GMGraphicsMBS.StrokeColor(c as GMColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Set color to use when drawing lines or object outlines.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.StrokeLineCap(LineCap as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify the shape to be used at the end of open subpaths when they are stroked.

Values of LineCap are UndefinedCap, ButtCap, RoundCap, and SquareCap.

GMGraphicsMBS.StrokeLineJoin(LineJoin as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify the shape to be used at the corners of paths (or other vector shapes) when they are stroked.

Values of LineJoin are UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin.

GMGraphicsMBS.StrokeOpacity(opacity as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Opacity to use when drawing lines or object outlines.

GMGraphicsMBS.StrokeWidth(opacity as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Set width to use when drawing lines or object outlines.

GMGraphicsMBS.Text(x as Double, y as Double, text as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate image with text using stroke color, font, font pointsize, and box color (text background color), at specified coordinates.
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

Var draw as GMGraphicsMBS = image.Graphics

// draw red text
draw.strokeColor(new GMColorRGBMBS("red")) // Outline color
draw.strokeWidth(1)
draw.Font("/Library/Fonts/Verdana.ttf")
draw.Text(50, 50, "Hello")
draw.Draw

Backdrop=image.CopyPicture

If text contains special format characters the image filename, type, width, height, or other image attributes may be incorporated in the text (see label).

See also:

GMGraphicsMBS.Text(x as Double, y as Double, text as string, encoding as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Annotate image with text represented with text encoding, using current stroke color, font, font pointsize, and box color (text background color), at specified coordinates.

If text contains special format characters the image filename, type, width, height, or other image attributes may be incorporated in the text (see label()).

The text encoding specifies the code set to use for text annotations. The only character encoding which may be specified at this time is "UTF-8" for representing Unicode as a sequence of bytes. Specify an empty string to set text encoding to the system's default. Successful text annotation using Unicode may require fonts designed to support Unicode.

Seems like you need ghostscript or the DPS library for text handling, so it may no be available for you.

See also:

GMGraphicsMBS.TextAntialias(flag as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Antialias while drawing text (default true).

The main reason to disable text antialiasing is to avoid adding new colors to the image.

GMGraphicsMBS.TextDecoration(DecorationType as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Specify decoration (e.g. UnderlineDecoration) to apply to text.

GMGraphicsMBS.TextUnderColor(c as GMColorMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Draw a box under rendered text using the specified color.

GMGraphicsMBS.Translation(x as Double, y as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Apply coordinate translation (set new coordinate origin).
Example
Var g as new GMGeometryMBS(500,500)
Var c as new GMColorRGBMBS("white") // white
Var image as new GMImageMBS(g, c)

image.strokeWidth = 5

Var draw as GMGraphicsMBS = image.Graphics

draw.StrokeColor new GMColorRGBMBS("red")
draw.Line(100,100,400,400)
draw.Translation 5,5
draw.StrokeColor new GMColorRGBMBS("blue")
draw.Line(100,100,400,400)
draw.Draw

Backdrop=image.CopyPicture

GMGraphicsMBS.Viewbox(x1 as Integer, y1 as Integer, x2 as Integer, y2 as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GraphicsMagick MBS GraphicsMagick Plugin 10.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Dimensions of the output viewbox.

If the image is to be written to a vector format (e.g. MVG or SVG), then a PushGraphicContext() object should be pushed to the head of the list, followed by a Viewbox() statement to establish the output canvas size. A matching PopGraphicContext() object should be pushed to the tail of the list.

The items on this page are in the following plugins: MBS GraphicsMagick Plugin.


The biggest plugin in space...