• 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
compositeToPoint with alpha
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

compositeToPoint with alpha


  • Subject: compositeToPoint with alpha
  • From: Lorenzo <email@hidden>
  • Date: Wed, 09 Mar 2005 16:06:55 +0100

HI,
I am trying to blend several images in one using different alpha for each
image. I use the API compositeToPoint, but I cannot get the effect I need.
I need the first image looks as originally with alpha = 1.0, then the other
images should have a decreasing alpha value. When I run the code below I get
exactly the opposite, that is the last image is much more visible than the
first one. I presume the error has something to do with multiplying alpha
value, but how to fix the error?

float   alpha = 1.0;
int     totImages = 10;
for(i = 0; i < totImages; i++){
    *anImage = [theImages objectAtIndex:i];
    [workImage lockFocus];
        [anImage compositeToPoint:NSZeroPoint
        fromRect:finalRect operation:NSCompositeSourceOver fraction:alpha];
    [workImage unlockFocus];
    alpha -= 0.1;
}


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: SystemStatusBar question
  • Next by Date: Re: Querying & Altering iTunes Preferences
  • Previous by thread: Re: NSTableView and automatic resize to fit all information
  • Next by thread: problem when combining InstallEventHandler with TrackMouseLocationWithOptions
  • Index(es):
    • Date
    • Thread