0
  • UIGraphicsBeginImageContextWithOptions function's size parameter is too large, resulting in memory surge.
  • I use size data, which is about 3 times the height and width of the screen size, which is
    (3*UIScreen.main.bounds.height,3*UIScreen.main.bounds.width). But when generating the image context, it produces huge memory, which is definitely not working.
  • How to generate a smaller image context memory, I think about a way to solve, is to generate a local(partial) context, but I feel this will produce too many steps.
  • I hope that a friend can discuss this issue with me and propose a better solution
绝尘牙
  • 1
  • 2
  • Divide **UIScreen.main.bouns.height** and **UIScreen.main.bouns. weught** by two – A.Munzer Jul 02 '18 at 07:16
  • @A.Munzer,it's a spelling mistake,`let size = (3*UIScreen.main.bounds.height,3*UIScreen.main.bounds.width)` – 绝尘牙 Jul 02 '18 at 07:56
  • Because the screen size certainly cannot display the entire context of the layer, when the screen is displayed in a certain area of the full context, a local context is created to draw the image data of this area, which can reduce the memory, but this is a bit too much trouble, I hope A friend can propose a solution to the memory compression of the image context – 绝尘牙 Jul 02 '18 at 08:04

0 Answers0