Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Firstoff, I'm a newbie to Cocoa frameworks, Objective-C and iPhone development. I'm working on an application, wherein I've decided to put an image in the ellipse which I'm filling up into a rectangle, using the normal method:
CGContextFillEllipseInRect()
Now, I've been through the API reference, but I couldn't figure out a way to do this. Can anyone suggest me something in this regards?
And also related to the same app, I've another question: Is it possible to get a border around your rects and ellipse? how can you achieve it?
Read the Quartz 2D Programming Guide and look at the section on clipping regions. You are going to want to set the ellipse as a clipping region then draw the image.
Read the Quartz 2D Programming Guide and look at the section on clipping regions. You are going to want to set the ellipse as a clipping region then draw the image.
Hi,
I've been through Quartz 2D Programming documentation and I have even created my application with an image clipped by the ellipse. But my query is, how to display the image without clipping it inside the ellipse. To further elaborate this, i've attached a logoEllipse.png file. In the attached, the rectangle represents the image's rectangle. When I use the normal:
CGContextAddInRect() or CGcontextFillEllipseInRect()
method, I'd get the small ellipse shown inside the rectangle, clipping the rest of the image. What I'm actually looking for is, the way to put the image, inside an ellipse, which is represented by the outer, bigger ellipse. I've tried work arounds here and there, but could not achieve the desired effect. If anyone have any suggestion, I'll appreciate it.
OK, I think I understand what you want now. Draw the bigger ellipse first. Then you need to draw the image with a smaller rectangle than used by the ellipse. A little trial and error should give you the correct ratio of the two rectangles so the image just fits inside the outer ellipse.
OK, I think I understand what you want now. Draw the bigger ellipse first. Then you need to draw the image with a smaller rectangle than used by the ellipse. A little trial and error should give you the correct ratio of the two rectangles so the image just fits inside the outer ellipse.
Hi RickMaddy, you're right. I'll do that. I guess a little trial and error should do the trick. Actually, the reason why I'd asked this query was that, I thought that, there might be a method/tricky workaround somewhere, through which we can draw the ellipse outside the rectangle( and since being a new-born in the Xcode-world, I thought to ask over here to clarify it) anyways, Thanks for the responses. I think those really helped me alot to proceed further.
Hiii.. I'm new in this forum,and in objective-c too... and this is my first post :) So the question is... How can i draw sectors in the ellipse...?? or how can i get random point coordinates from the ellipse... Thanks in advance :)
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI've been through Quartz 2D Programming documentation and I have even created my application with an image clipped by the ellipse.
But my query is, how to display the image without clipping it inside the ellipse. To further elaborate this, i've attached a logoEllipse.png file.
In the attached, the rectangle represents the image's rectangle. When I use the normal:
method, I'd get the small ellipse shown inside the rectangle, clipping the rest of the image. What I'm actually looking for is, the way to put the image, inside an ellipse, which is represented by the outer, bigger ellipse.
I've tried work arounds here and there, but could not achieve the desired effect.
If anyone have any suggestion, I'll appreciate it.
Thanks.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeyou're right. I'll do that. I guess a little trial and error should do the trick.
Actually, the reason why I'd asked this query was that, I thought that, there might be a method/tricky workaround somewhere, through which we can draw the ellipse outside the rectangle( and since being a new-born in the Xcode-world, I thought to ask over here to clarify it)
anyways, Thanks for the responses. I think those really helped me alot to proceed further.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSo the question is...
How can i draw sectors in the ellipse...?? or how can i get random point coordinates from the ellipse...
Thanks in advance :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome