Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Spike099

macrumors regular
Original poster
Feb 18, 2007
143
0
Canada
Alright, I apologize if this has been asked already however I cannot find anything about it. I am looking to create the image reflection effect that is seen in many os x apps like frontrow, iweb, keynote and many others.

Do I have to create a filter using CIImage? Or is this done using CGImage or even an NSImage? Any pointers are appreciated, thanks.
 

ATG

macrumors regular
Aug 7, 2005
187
0
Alright, I apologize if this has been asked already however I cannot find anything about it. I am looking to create the image reflection effect that is seen in many os x apps like frontrow, iweb, keynote and many others.

Do I have to create a filter using CIImage? Or is this done using CGImage or even an NSImage? Any pointers are appreciated, thanks.
http://www.kaintek.com/?page_id=40

I haven't used it, but a google goes a long way ;)
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7

ATG

macrumors regular
Aug 7, 2005
187
0
Aw shucks :eek: :)

I just updated the Subversion URL for the code, so it is actually downloadable (via 'svn co ...'). It isn't the best code for doing this, and doesn't work well with transparent images.

What would be best is to make a view that draws another view as a reflection. I haven't yet figured out how to do that though.
Why not just draw the normal view into an image and then reflect that?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Aw shucks :eek: :)

I just updated the Subversion URL for the code, so it is actually downloadable (via 'svn co ...'). It isn't the best code for doing this, and doesn't work well with transparent images.

If I'd know it was you... :eek:

What doesn't work with transparent images? Do the colours shift?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
What doesn't work with transparent images? Do the colours shift?

When I draw the reflected image, I draw a gradient over the image that fades to the background color, so wherever there's transparency, it draws over that, instead of ignoring it. I need to find a way of clipping the drawing using the image's mask.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
When I draw the reflected image, I draw a gradient over the image that fades to the background color, so wherever there's transparency, it draws over that, instead of ignoring it. I need to find a way of clipping the drawing using the image's mask.

Ah. I didn't look at the code but I assumed you'd used the gradient as an alpha mask. I was expecting to here tails of wow around pre-multiplied alpha images...
 

Spike099

macrumors regular
Original poster
Feb 18, 2007
143
0
Canada
Thank you

Thanks for the feedback guys. I haven't tried these samples yet as I ran into another noobish problem thats preventing me from trying. I'll post the problem in a new thread.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.