Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating reflected style Images from NSImage



I know how to use Core Image code and transformations, but do
not see code that would do this effect. Or can it be simply done
using NSImage draw calls or Quartz draw commands, with a given alpha
mask?  If there is a source example of this online, I am missing it.

The easiest way is probably to use NSAffineTransform to flip it in the y direction:

   NSAffineTransform *tr = [[NSAffineTransform alloc] init];
   [tr setScaleXBy:1 yBy:-1];
   [tr set];
   // draw with -[NSImage draw:atPoint:fromRect:operation:fraction:]
or whatever

Drawing the gradient, etc, would be done with the standard Quartz
gradient jibberish.  If you use an NSImage as a buffer, you could draw
the gradient into that with whatever alpha values you'd like, then
composite your image over it (after setting the transformation) using
the NSCompositeSourceAtop operator.

--sjd;
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Creating reflected style Images from NSImage (From: Steve Sheets <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.