Platforms to show: All Mac Windows Linux Cross-Platform

Back to GMGraphicsMBS class.

Previous items

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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

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

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

image.strokeWidth = 5

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

image.strokeWidth = 5

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

image.strokeWidth = 5

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

image.strokeWidth = 5

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

dim 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
dim g as new GMGeometryMBS(500,500)
dim c as new GMColorRGBMBS("white") // white
dim image as new GMImageMBS(g, c)

image.strokeWidth = 5

dim 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.

Previous items

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


The biggest plugin in space...