createDp

fun createDp(drawable: Drawable?, scaleType: ImageView.ScaleType = ScaleType.FIT_CENTER, useIntrinsicSize: Boolean = true, widthDp: Float? = null, heightDp: Float? = null, style: Style? = null): PrimitiveImage

Java-compatible factory method that accepts dp values for dimensions. Use this method when calling from Java code with dp values (e.g., from .widthDip() or .heightDip() calls).

Parameters

drawable

The Drawable to render.

scaleType

The ScaleType to scale or transform the drawable.

useIntrinsicSize

Whether to use the intrinsic size of the drawable.

widthDp

Width in dp, or null to not set.

heightDp

Height in dp, or null to not set.

style

Additional style to apply, or null for no additional style.