android-signaturepad icon indicating copy to clipboard operation
android-signaturepad copied to clipboard

[Feature Request] Expose trimBlankSpace option through the SignaturePadAdapter

Open rhappe opened this issue 6 months ago • 0 comments

Is your feature request related to a problem? Please describe. The SignaturePadAdapter exposes an API to get the resulting Bitmap from the SignaturePad view, but it doesn't give an option to get the version of the signature image that removes the blankspace by cropping to the real bounds of the signature.

Describe the solution you'd like Add a trimBlankSpace passthrough parameter to getTransparentSignatureBitmap that will provide the image with the blank space surrounding the signature removed.

fun getTransparentSignatureBitmap(trimBlankSpace: Boolean = false): Bitmap {
    return signaturePad.getTransparentSignatureBitmap(
        trimBlankSpace = trimBlankSpace,
    )
}

Describe alternatives you've considered Right now my workaround was to copy the SignaturePad compose wrapper (found here) and the SignaturePadAdapter and add the parameter to my "custom" implementation.

Additional context N/a

rhappe avatar Aug 22 '24 14:08 rhappe