I'm displaying a series of images on an iPad that are being sent over a network connection. It seems to work fine, but the images have a lot of ghosting for some reason (see image below). Is there some kind of technique for drawing that would eliminate this? I'd say it's an issue with the refresh rate of the screen, but that wouldn't explain why using the iPad's screenshot functionality captures the phenomenon.
Asked
Active
Viewed 203 times
0
-
How are you switching between images? Since you tagged the question with Core Animation I'm assuming that there are animations involved? Are you doing some cross-fade between images? – David Rönnqvist Jun 12 '12 at 20:13
-
A screenshot is only going to read out what is in RAM being displayed, the true pixels are not readable. What is going on MUST be a processing phenomenon. What processing is going on, on the images? – trumpetlicks Jun 12 '12 at 22:39
1 Answers
1
You are probably switching between images in a way that triggers an implicit animation that cross-fades between the old image and the new one.
The documentation for layer actions explains how CoreAnimation is deciding to run that implicit animation, and how to override it.
The two easiest ways IMHO are:
- When you change the image, use a
CATransaction
to disable actions - In your layer's delegate, implement
-actionForLayer:forKey:
and return[NSNull null]
. (If you are using aUIView
, it's already the layer's delegate.)
This question gives a few more options -- it might even be a duplicate of your situation.

Community
- 1
- 1

Kurt Revis
- 27,695
- 5
- 68
- 74
-
Thanks for the responses. I have a layer defined, and I'm calling the `SetContents:` method as such: `[imageLayer_ performSelectorOnMainThread:@selector(setContents:) withObject:(id)self.cameraImage_.CGImage waitUntilDone:NO];`. The cameraImage_ object is a UIImage object. – automatom Jun 13 '12 at 19:25