• 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: Creating reflected style Images from NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating reflected style Images from NSImage


  • Subject: Re: Creating reflected style Images from NSImage
  • From: "Stephen Deken" <email@hidden>
  • Date: Thu, 28 Sep 2006 13:26:16 -0500

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:
This email sent to email@hidden


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

  • Prev by Date: Creating reflected style Images from NSImage
  • Next by Date: Re: Re: How to check if NSTextField is selected?
  • Previous by thread: Creating reflected style Images from NSImage
  • Next by thread: RE: NSImage leaking memory or just me
  • Index(es):
    • Date
    • Thread