If an image context is created using:

UIGraphicsBeginImageContextWithOptions(CGSizeMake(768, 768), YES, 1.0);

is there a way to get the size of the context later on? The size for sure is there when the image is obtained from the context, but while drawing, is there also a way to get the width and size of it?

1

There are 1 answers

3
Simon Lawrence On BEST ANSWER

For a bitmap context as above you can use:

CGContextRef context = UIGraphicsGetCurrentContext();
size_t width = CGBitmapContextGetWidth(context);
size_t height = CGBitmapContextGetHeight(context);