My app uses core graphics for custom finger paint drawing. I allow the user to change the alpha of the line and a new line is continuously drawn on touches moved. When I make the alpha lower than 1.0 the point of overlap is darker than the rest of the line. I know why this occurs but how can I stop this?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- How to get a CGImageRef from Context-Drawn Images?
I suppose you want a single stroke not to darken itself, but still to darken previous strokes (that's how most painting apps work).
For this to work, you need two views/buffers, one for the 'current background' and one for the current stroke. Merge the latter with the background when the finger is released.
You always draw with alpha 1 in the current stroke buffer, but you display and merge it with a lower alpha.