Picture

class Picture(val bytes: ByteArray, val format: PictureFormat?, val width: Int?, val height: Int?, val goalWidthTwips: Int?, val goalHeightTwips: Int?, val scaleXPercent: Int = 100, val scaleYPercent: Int = 100) : RtfEvent(source)

A decoded \pict group. It follows the pict Command that opened the group and precedes the group's GroupEnd; the group's hex payload and nested groups are not emitted as events.

width and height are the raw \picwN / \pichN values, whose units vary by producer: the spec says pixels for bitmaps, but Word writes hundredths of a millimetre even for PNG and JPEG. Use goalWidthTwips / goalHeightTwips, scaled by scaleXPercent / scaleYPercent, for the display size.

Parameters

bytes

the image data, from the group's hex text or its \binN blob.

format

the declared encoding, or null when the group names none the parser knows.

width

the raw \picwN source width.

height

the raw \pichN source height.

goalWidthTwips

the \picwgoalN rendered width in twips, before scaling.

goalHeightTwips

the \pichgoalN rendered height in twips, before scaling.

scaleXPercent

the \picscalexN horizontal scale. Word keeps the goals at the picture's original size and records a user resize here.

scaleYPercent

the \picscaleyN vertical scale, as for scaleXPercent.

Constructors

Link copied to clipboard
constructor(bytes: ByteArray, format: PictureFormat?, width: Int?, height: Int?, goalWidthTwips: Int?, goalHeightTwips: Int?, scaleXPercent: Int = 100, scaleYPercent: Int = 100)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val height: Int?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val width: Int?

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String