icerockdev / moko-media

Media selection & presenting for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev/
Apache License 2.0
120 stars 12 forks source link

How to pass image to shared module from ios #32

Closed Prabhuidsoft closed 2 years ago

Prabhuidsoft commented 3 years ago

We are need pass uiimage to shared module or need common bytearray for processing image.

Alex009 commented 3 years ago

in common code available Bitmap class - https://github.com/icerockdev/moko-media/blob/master/media/src/commonMain/kotlin/dev/icerock/moko/media/Bitmap.kt with toByteArray() support.

new instance of this class created in platform side from android bitmap https://github.com/icerockdev/moko-media/blob/master/media/src/androidMain/kotlin/dev/icerock/moko/media/Bitmap.kt#L10

and from ios uiimage https://github.com/icerockdev/moko-media/blob/master/media/src/iosMain/kotlin/dev/icerock/moko/media/Bitmap.kt#L13