How do I create a png image from text in iOS?
Asked
Active
Viewed 571 times
2 Answers
1
It's covered in one of the first lectures in this term of Stanford's free iPhone programming course. There's a video and PDF notes.
Basically, you can create a UIImage
and use its graphics context to draw into it, then save a PNG representation of the image.

Cœur
- 37,241
- 25
- 195
- 267

Jeff Kelley
- 19,021
- 6
- 70
- 80
-
There is more than one video, so you may want to specify which Lecture it is. – Cœur Jun 07 '19 at 17:24
1
How to save a view as an image:
UIGraphicsBeginImageContext(myView.bounds.size);
[myView.layer renderInContext:UIGraphicsGetCurrentContext()];
viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

Cœur
- 37,241
- 25
- 195
- 267

Corey Floyd
- 25,929
- 31
- 126
- 154