//qrcode-kotlin/qrcode.render/QRCodeGraphics

QRCodeGraphics

[common]
expect class QRCodeGraphics(width: Int, height: Int)

[android, js, jvm]
actual open class QRCodeGraphics(val width: Int, val height: Int)

Constructors

   
QRCodeGraphics [common]
expect constructor(width: Int, height: Int)
[android, js, jvm]
actual constructor(width: Int, height: Int)

Types

Name Summary
Companion [android, js]
[android]
object Companion
[js]
object Companion

Properties

Name Summary
height [android, js, jvm]
[android]
val height: Int
[js]
val height: Int
[jvm]
val height: Int
width [android, js, jvm]
[android]
val width: Int
[js]
val width: Int
[jvm]
val width: Int

Functions

Name Summary
availableFormats [common, android, js, jvm]
[common]
expect fun availableFormats(): Array<String>
[android, js, jvm]
actual open fun availableFormats(): Array<String>
Returns the available formats to be passed as parameters to getBytes.
changed [common, android, js, jvm]
[common]
expect fun changed(): Boolean
[android, js, jvm]
actual open fun changed(): Boolean
Returns true if any drawing was performed
dimensions [common, android, js, jvm]
[common]
expect fun dimensions(): Array<Int>
[android, js, jvm]
actual open fun dimensions(): Array<Int>
Return the dimensions of this Graphics object as a pair of width, height
directDraw [jvm]
fun directDraw(action: Consumer<Graphics2D>)
Available so the user can implement their own, 100% custom drawing.
drawEllipse [common, android, js]
[common]
expect fun drawEllipse(x: Int, y: Int, width: Int, height: Int, color: Int, thickness: Double)
[android, js]
actual fun drawEllipse(x: Int, y: Int, width: Int, height: Int, color: Int, thickness: Double)
Draw the edges of an ellipse (aka "a circle") which occupies the area (x,y,width,height)
[jvm]
actual open fun drawEllipse(x: Int, y: Int, width: Int, height: Int, color: Int, thickness: Double)
Draw the edges of an ellipsis (aka "a circle") which occupies the area (x,y,width,height)
drawImage [android, jvm]
[android]
open fun drawImage(img: Bitmap, x: Int, y: Int)
[jvm]
open fun drawImage(image: BufferedImage?, x: Int, y: Int)
[common, android, jvm]
[common]
expect fun drawImage(rawData: ByteArray?, x: Int, y: Int)
[android]
actual fun drawImage(rawData: ByteArray?, x: Int, y: Int)
[jvm]
actual open fun drawImage(rawData: ByteArray?, x: Int, y: Int)
Reads the specified image from rawData and draws it at (x,y)
[js]
actual fun drawImage(rawData: ByteArray?, x: Int, y: Int)
Reads the specified image from rawData and draws it at (x,y).
drawLine [common, android, js, jvm]
[common]
expect fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int, color: Int, thickness: Double)
[android, js, jvm]
actual open fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int, color: Int, thickness: Double)
Draw a straight line from point (x1,y1) to (x2,y2).
drawRect [common, android, js, jvm]
[common]
expect fun drawRect(x: Int, y: Int, width: Int, height: Int, color: Int, thickness: Double)
[android, js, jvm]
actual open fun drawRect(x: Int, y: Int, width: Int, height: Int, color: Int, thickness: Double)
Draw the edges of a rectangle starting at point (x,y) and having width by height.
drawRoundRect [common, android, js, jvm]
[common]
expect fun drawRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int, thickness: Double)
[android, js, jvm]
actual open fun drawRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int, thickness: Double)
Draw the edges of a round rectangle starting at point (x,y) and having width by height with edges that are borderRadius pixels round (almost like CSS).
fill [common, android, js, jvm]
[common]
expect fun fill(color: Int)
[android, js, jvm]
actual open fun fill(color: Int)
Fill the whole area of this canvas with the specified color.
fillEllipse [common, android, js]
[common]
expect fun fillEllipse(x: Int, y: Int, width: Int, height: Int, color: Int)
[android, js]
actual fun fillEllipse(x: Int, y: Int, width: Int, height: Int, color: Int)
Fills an ellipse (aka "a circle") which occupies the area (x,y,width,height)
[jvm]
actual open fun fillEllipse(x: Int, y: Int, width: Int, height: Int, color: Int)
Fills an ellipsis (aka "a circle") which occupies the area (x,y,width,height)
fillRect [common, android, js, jvm]
[common]
expect fun fillRect(x: Int, y: Int, width: Int, height: Int, color: Int)
[android, js, jvm]
actual open fun fillRect(x: Int, y: Int, width: Int, height: Int, color: Int)
Fills the rectangle starting at point (x,y) and having width by height.
fillRoundRect [common, android, js, jvm]
[common]
expect fun fillRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int)
[android, js, jvm]
actual open fun fillRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int)
Fills the round rectangle starting at point (x,y) and having width by height with edges that are borderRadius pixels round (almost like CSS).
getBytes [common, js]
[common]
expect fun getBytes(): ByteArray
[js]
actual open fun getBytes(): ByteArray
Returns this image as a ByteArray encoded as PNG.
[android]
actual open fun getBytes(): ByteArray
Returns this image as a ByteArray encoded as PNG. Recommended to use writeImage.
[jvm]
actual open fun getBytes(): ByteArray
Returns this image as a ByteArray encoded as PNG. Usually recommended to use writeImage instead :)
[common, js]
[common]
expect fun getBytes(format: String): ByteArray
[js]
actual open fun getBytes(format: String): ByteArray
Returns this image as a ByteArray encoded as the specified format (e.g. PNG, JPG, BMP, …).
[android]
actual open fun getBytes(format: String): ByteArray
Returns this image as a ByteArray encoded as the specified format. Recommended to use writeImage.
[jvm]
actual open fun getBytes(format: String): ByteArray
Returns this image as a ByteArray encoded as the specified format. Usually recommended to use writeImage instead :)
nativeImage [common, js]
[common]
expect fun nativeImage(): Any
[js]
actual open fun nativeImage(): Any
Returns the native image object this QRCodeGraphics is working upon.
[android]
actual open fun nativeImage(): Any
Returns the Bitmap object being worked upon.
[jvm]
actual open fun nativeImage(): Any
Returns the BufferedImage object being worked upon.
reset [common]
expect fun reset()
Completely reset this object. It is expected that changed() returns false and the canvas is completely blank after invoking this.
[android, js, jvm]
[android, js, jvm]
actual fun reset()
Simply changes the changed flag to true without doing anything else
toBlob [js]
open fun toBlob(callback: (Blob?) -> Unit)
Direct access to the .toBlob() function of the underlying canvas.
toDataURL [js]
open fun toDataURL(format: String = "png"): String
Returns a Data URL to this can be shown in an <img/> tag.
writeImage [jvm]
@JvmOverloads
open fun writeImage(destination: OutputStream, format: String = "PNG")
Writes the QRCode image in the specified format into the destination OutputStream.
[android]
open fun writeImage(destination: OutputStream, format: String = "PNG", quality: Int = 100)
Writes the QRCode image in the specified format and quality into the destination OutputStream.