Search code examples
iosswiftmetalmetalkit

How can I create a OffScreen Buffer with Image Texture Data


I want to create a offscreen buffer with image loaded to it. When user do the changes have to been done in the texture which is in the Offscreen Buffer.


Solution

  • You can use UIGraphicsImageRenderer to draw into an offscreen context and get back a UIImage. Its like an other graphics context, so all of the Coregraphics and UIKit drawing methods work inside UIGraphicsImageRenderer.