https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
a

Andrew Watson

09/26/2023, 7:41 PM
Hey anyone got a code snippet to rotate a
UIImage
in kotlin-wrapped iOS code? The compose imageviewer sample doesn't have this case covered, and trying to translate the common code online doesn't work. For example, this doesn't work:
let rotationTransform = CGAffineTransform(rotationAngle: rotationAngle)
In Kotlin, I can do:
Copy code
val rotMat = CGAffineTransformMake(0.0, 1.0, -1.0, 0.0, 0.0, 0.0)
but now I need a way to apply it to my UIImage
@Dima Avdeev I see you wrote a lot of the code to do the image manipulation in imageviewer; do you have any tips? I'm just trying to do a simple image rotation
d

Dima Avdeev

10/24/2023, 1:31 PM
Sorry, I wrote it in past. And actually forgot some of this code. I think you can copy/paste it as is and try to shrink some redundant features.