Home > Mobile >  How to make CGWindowListCreateImage render correct background color?
How to make CGWindowListCreateImage render correct background color?

Time:12-01

Capturing an image of an off-screen window with CGWindowListCreateImage is a common way to create QuickLook style zoom-in animations, but this seems create an image with the wrong background colour, slightly lighter than the real window.

This causes a flash at the end of the animation which kind of ruins the effect.

Does anyone have any idea why this happens and what can be done about it?

EDIT: I created a Comparison of the final window and snapshot

CodePudding user response:

Setting the window appearance to textured in Interface Builder fixed this. Of course that also changes the color of the window, but that is acceptable in this particular case.

  • Related