DrawingWand

class DrawingWand : Closeable

DrawingWand API. For drawing things on the image (such as text).

Constructors

Link copied to clipboard
fun DrawingWand()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
external fun clear()

Clear the wand contents.

Link copied to clipboard
external fun clearException()

Clear any internal exceptions

Link copied to clipboard
fun clone(): DrawingWand

Clone the wand into a new one.

Link copied to clipboard
open override fun close()

This isn't meant to be called manually. You can call destroy instead. This does the same thing as destroy, but it's here to be used with a use{} block for convenience. For example wand.use { }

Link copied to clipboard
external fun destroy()

It's recommended to manually destroy all wands when finished.

Link copied to clipboard
external fun drawAnnotation(x: Double, y: Double, text: String)

Draws text on the image.

Link copied to clipboard
external fun getException(): NativeMagickException

Get the internal exception type and message

Link copied to clipboard
fun getExceptionType(): ExceptionType

Get the type of internal exception

Link copied to clipboard
external fun isWand(): Boolean

Verifies whether this is a DrawingWand.

Properties

Link copied to clipboard
var borderColor: PixelWand

The border color used for drawing bordered objects.

Link copied to clipboard
var clipPath: String?

The current (named) clipping path ID associated with the image. Only the areas drawn on by the clipping path will be modified as ssize_t as it remains in effect.

Link copied to clipboard
var clipRule: FillRule

The current polygon fill rule to be used by the clipping path.

Link copied to clipboard
var clipUnits: ClipPathUnits

The interpretation of clip path units.

Link copied to clipboard
var fillColor: PixelWand

The fill color used for drawing filled objects.

Link copied to clipboard
var fillOpacity: Double

The alpha used when drawing using the fill color or fill texture. Fully opaque is 1.0.

Link copied to clipboard
var fillRule: FillRule

The fill rule used while drawing polygons.

Link copied to clipboard
var font: String?

The fully-specified font used when annotating with text.

Link copied to clipboard
var fontFamily: String?

The font family to use when annotating with text.

Link copied to clipboard
var fontSize: Double

The font pointsize used when annotating with text.

Link copied to clipboard
var fontStretch: StretchType

The font stretch used when annotating with text. The StretchType.AnyStretch enumeration acts as a wild-card.

Link copied to clipboard
var fontStyle: StyleType

The font style used when annotating with text. The StyleType.AnyStyle enumeration acts as a wild-card "don't care" option.

Link copied to clipboard
var fontWeight: Long

The font weight used when annotating with text. Font weight valid range: 100-900

Link copied to clipboard
var gravity: GravityType

The text placement gravity used when annotating with text.

Link copied to clipboard
val id: ULong

The unique id of the wand.

Link copied to clipboard
val isInitialized: Boolean

Check to see if this is initialized with the underlying C obj. If it's not, then calling any functions will result in a null exception.

Link copied to clipboard
var opacity: Double

The alpha used when drawing with the fill or stroke color or texture. Fully opaque is 1.0.

Link copied to clipboard
var strokeAntialias: Boolean

The current stroke antialias setting. Stroked outlines are antialiased by default. When antialiasing is disabled stroked pixels are thresholded to determine if the stroke color or underlying canvas color should be used.

Link copied to clipboard
var strokeColor: PixelWand

The color used for stroking object outlines.

Link copied to clipboard
var strokeDashOffset: Double

The offset into the dash pattern to start the dash.

Link copied to clipboard
var strokeLineCap: LineCap

The shape to be used at the end of open subpaths when they are stroked.

Link copied to clipboard
var strokeLineJoin: LineJoin

The shape to be used at the corners of paths (or other vector shapes) when they are stroked.

Link copied to clipboard
var strokeMiterLimit: Long

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

Link copied to clipboard
var strokeOpacity: Double

The alpha of stroked object outlines. The value 1.0 is opaque.

Link copied to clipboard
var strokeWidth: Double

The width of the stroke used to draw object outlines.

Link copied to clipboard
var textAlignment: AlignType

The alignment applied when annotating with text.

Link copied to clipboard
var textAntialias: Boolean

The current text antialias setting, which determines whether text is antialiased. Text is antialiased by default. Set to false to disable antialiasing.

Link copied to clipboard
var textDecoration: DecorationType

The decoration applied when annotating with text.

Link copied to clipboard
var textDirection: DirectionType

The direction that will be used when annotating with text.

Link copied to clipboard
var textEncoding: String

The code set used 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.

Link copied to clipboard
var textInterlineSpacing: Double

The spacing between line in text.

Link copied to clipboard
var textInterwordSpacing: Double

The spacing between words in text.

Link copied to clipboard
var textKerning: Double

The spacing between characters in text.

Link copied to clipboard
var textUnderColor: PixelWand

The color of a background rectangle to place under text annotations.

Link copied to clipboard
var vectorGraphics: String?

The vector graphics generated by any graphics calls made since the wand was instantiated. Setting will set the vector graphics associated with the specified wand using the specified DrawingWand XML. Use this method with vectorGraphics as a method to persist the vector graphics state.