QRCodeGraphics

actual class QRCodeGraphics(width: Int, height: Int)
expect class QRCodeGraphics(width: Int, height: Int)
actual class QRCodeGraphics(width: Int, height: Int)

Functions

Link copied to clipboard
actual fun availableFormats(): List<String>

Returns the available formats to be passed as parameters to getBytes.

expect fun availableFormats(): List<String>

Returns the available formats to be passed as parameters to getBytes.

actual fun availableFormats(): List<String>

Returns the available formats to be passed as parameters to getBytes.

Link copied to clipboard
actual fun drawImage(img: QRCodeGraphics, x: Int, y: Int)

Draw an image inside another. Mostly used to merge squares into the main QRCode.

expect fun drawImage(img: QRCodeGraphics, x: Int, y: Int)

Draw an image inside another. Mostly used to merge squares into the main QRCode.

actual fun drawImage(img: QRCodeGraphics, x: Int, y: Int)

Draw an image inside another. Mostly used to merge squares into the main QRCode.

Link copied to clipboard
actual fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int, color: Int)

Draw a straight line from point (x1,y1) to (x2,y2).

expect fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int, color: Int)

Draw a straight line from point (x1,y1) to (x2,y2).

actual fun drawLine(x1: Int, y1: Int, x2: Int, y2: Int, color: Int)

Draw a straight line from point (x1,y1) to (x2,y2).

Link copied to clipboard
actual fun drawRect(x: Int, y: Int, width: Int, height: Int, color: Int)

Draw the edges of a rectangle starting at point (x,y) and having width by height.

expect fun drawRect(x: Int, y: Int, width: Int, height: Int, color: Int)

Draw the edges of a rectangle starting at point (x,y) and having width by height.

actual fun drawRect(x: Int, y: Int, width: Int, height: Int, color: Int)

Draw the edges of a rectangle starting at point (x,y) and having width by height.

Link copied to clipboard
actual fun drawRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int)

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

expect fun drawRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int)

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

actual fun drawRoundRect(x: Int, y: Int, width: Int, height: Int, borderRadius: Int, color: Int)

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

Link copied to clipboard
actual fun fill(color: Int)

Fill the whole area of this canvas with the especified color.

expect fun fill(color: Int)

Fill the whole area of this canvas with the especified color.

actual fun fill(color: Int)

Fill the whole area of this canvas with the especified color.

Link copied to clipboard
actual 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.

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

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

Link copied to clipboard
actual 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).

expect 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).

actual 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).

Link copied to clipboard
actual fun getBytes(): ByteArray

Returns this image as a ByteArray encoded as PNG. Recommended to use writeImage.

actual fun getBytes(format: String): ByteArray

Returns this image as a ByteArray encoded as the specified format. Recommended to use writeImage.

expect fun getBytes(): ByteArray

Returns this image as a ByteArray encoded as PNG.

expect fun getBytes(format: String): ByteArray

Returns this image as a ByteArray encoded as the specified format (e.g. PNG, JPG, BMP, ...).

actual fun getBytes(): ByteArray

Returns this image as a ByteArray encoded as PNG. Usually recommended to use writeImage instead :)

actual fun getBytes(format: String): ByteArray

Returns this image as a ByteArray encoded as the specified format. Usually recommended to use writeImage instead :)

Link copied to clipboard
actual fun nativeImage(): Any

Returns the Bitmap object being worked upon.

expect fun nativeImage(): Any

Returns the native image object this QRCodeGraphics is working upon.

actual fun nativeImage(): Any

Returns the BufferedImage object being worked upon.

Link copied to clipboard
fun writeImage(destination: OutputStream, format: String = "PNG", quality: Int = 100)

Writes the QRCode image in the specified format and quality into the destination OutputStream.

fun writeImage(destination: OutputStream, format: String = "PNG")

Writes the QRCode image in the specified format into the destination OutputStream.

Properties

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