Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android.graphics.Bitmap on iOS

I'm migrating an Android application to iOS.

On Android I have an android.graphics.Bitmap object and I don't know which object can I use on iOS.

I thought I can use CGBitmapContext or UIImage. And on the book Learn Objective-C for Java Developers, I haven't found anything useful.

On Android, first I have to created with a size, that I can use this Bitmap to get a JPEG version of it or I can draw some pixels on it.

What do you recommend me?

like image 368
VansFannel Avatar asked Apr 21 '26 12:04

VansFannel


1 Answers

Your best resource on how to do this is going to be Apple's Drawing and Printing Guide, specifically, Creating New Images Using Bitmap Graphics Contexts.

Once you go through the steps listed in the tutorial (and perform all the necessary drawing) and you get a reference to a UIImage, you'll want to use UIImageJPEGRepresentation to save the result as a JPEG.

like image 61
Ben S Avatar answered Apr 23 '26 00:04

Ben S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!