• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing images on top of each other
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing images on top of each other


  • Subject: Re: Drawing images on top of each other
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 3 Feb 2011 23:21:02 -0800

On Feb 3, 2011, at 22:58, Andrew Coad wrote:

>            //[[self touchClearImage] drawAtPoint:aPoint blendMode:kCGBlendModeNormal alpha:0.0]; // <-- see note below

This doesn't do anything -- alpha == 0 turns the source image fully transparent (in effect), and a transparent source has no effect in this mode.

>            [[item displayImage] drawAtPoint:aPoint
>                                  blendMode:kCGBlendModeNormal alpha:[[item displayImageAlpha] doubleValue]]; // <-- alpha is in fact 1.0

According to CGContext.h (I looked in the Mac OS X SDK version because it was handy, but I assume the iOS formulas are the same), blendMode kCGBlendModeNormal is:

	R = S + D*(1 - Sa)

which obviously blends the source into the destination. You probably want either kCGBlendModeCopy:

	R = S

or kCGBlendModeSourceAtop:

	R = S*Da + D*(1 - Sa)

depending on what you want to happen to transparency within the new image.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • RE: Drawing images on top of each other
      • From: Andrew Coad <email@hidden>
References: 
 >Drawing images on top of each other (From: Andrew Coad <email@hidden>)

  • Prev by Date: Best Approach in displaying the Image in Core Animation Layer - During the animation
  • Next by Date: Re: Multiple declarations of objc_msgSend_stret
  • Previous by thread: Drawing images on top of each other
  • Next by thread: RE: Drawing images on top of each other
  • Index(es):
    • Date
    • Thread