Mailing Lists: Apple Mailing Lists

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

Path gradient/shading



Hello,

I am trying to implement a complicated gradient/shading filling using
Quartz.
I need something like path gradient in GDI+ on Windows. The examples of path
gradient are:
<http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/graphics/pathgradien
t4.png>
<http://www.functionx.com/vcsharp/gdi/images/path1.gif>
I would like to divide the shape into triangles with one corner in the
center point of the shape and other 2 corners in the shape path. In the
first example it would be 3 triangles inside the big triangle, in the 2nd
example it would be 4 triangles inside the rectangle.
Each triangle would use the regular linear shading created with
CGShadingCreateAxial().
But the problem is when you draw 2 shaded triangles side by side, they do
not "stick" together nicely. There is an antialiased edge between them. So
the end effect is that you see the lines where those triangles are
connected. I tried to turn off antialiasing by calling
CGContextSetShouldAntialias(context, false) and the effect is that the edges
of neighbor triangles overlap. It looks OK with opaque colors but
unfortunately it shows edge when you use transparency (the same happens if I
try to expand the triangle size by 1 pixel so  the edges overlap).

Any advice how to glue shaded shapes together in a way that the edges don't
show?

Thanks,
Tom



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

This email sent to 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.