How to create a pattern with an image in a specific rectangle
How to create a pattern with an image in a specific rectangle
- Subject: How to create a pattern with an image in a specific rectangle
- From: Derrick Griffel <email@hidden>
- Date: Tue, 15 Mar 2005 09:04:30 -0600
I am trying to draw a pattern inside a particular rectangle drawn in my
view. The pattern is created from an NSImage . I am currently
creating the pattern using [NSColor colorWithPatternImage:myImage].
This works for creating the pattern from the image, but I would like to
draw the pattern inside of a specific rectangle in the view, and
colorWithPatternImage always tiles the image starting from the bottom
of the window. I have seen this issue brought up in this list before,
but I have not seen a solution presented yet for specifying your own
origin other than the bottom of the window. I would also like to apply
scaling and rotation transforms to my pattern, but this also seems
impossible to do when using colorWithPatternImage. I have also looked
at using Quartz to create and draw my pattern since it seems to do
everything I would like with patterns, scaling, rotation, and cell
spacing, but it appears to me that Quartz will only create patterns
using solid colors. If Quartz is my best bet for creating a pattern,
does anyone know how I can create a Quartz pattern from an image?
Thanks for any information.
Derrick Griffel
Intriguing Development Inc.
816-229-6768 ext. 12
www.idevelop.net
_______________________________________________
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