BitmapPainter
-
Cmn
class BitmapPainter : Painter
| kotlin.Any | ||
| ↳ | androidx.compose.ui.graphics.painter.Painter | |
| ↳ | androidx.compose.ui.graphics.painter.BitmapPainter |
Painter implementation used to draw an ImageBitmap into the provided canvas This implementation can handle applying alpha and ColorFilter to it's drawn result
Summary
Public constructors |
|
|---|---|
BitmapPainter(image: ImageBitmap, srcOffset: IntOffset, srcSize: IntSize) |
Cmn
|
Protected functions |
||
|---|---|---|
open Boolean |
applyAlpha(alpha: Float)Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied |
Cmn
|
open Boolean |
applyColorFilter(colorFilter: ColorFilter?)Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied |
Cmn
|
open Unit |
Implementation of drawing logic for instances of |
Cmn
|
Public properties |
||
|---|---|---|
open Size |
Return the dimension of the underlying |
Cmn
|
Inherited functions |
||||||
|---|---|---|---|---|---|---|
|
Public constructors
BitmapPainter
BitmapPainter(
image: ImageBitmap,
srcOffset: IntOffset = IntOffset.Zero,
srcSize: IntSize = IntSize(image.width, image.height)
)
| Parameters | |
|---|---|
image: ImageBitmap |
The |
srcOffset: IntOffset = IntOffset.Zero |
Optional offset relative to |
srcSize: IntSize = IntSize(image.width, image.height) |
Optional dimensions representing size of the subsection of
|
Protected functions
applyAlpha
protected open fun applyAlpha(alpha: Float): Boolean
Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied
applyColorFilter
protected open fun applyColorFilter(colorFilter: ColorFilter?): Boolean
Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied
Public properties
intrinsicSize
open val intrinsicSize: Size
Return the dimension of the underlying ImageBitmap as it's intrinsic width and height