Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 564841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:48:33+00:00 2026-05-13T12:48:33+00:00

I create a circle with a nice shadow with this code (I use MonoTouch.net

  • 0

I create a circle with a nice shadow with this code (I use MonoTouch.net for iPhone, Objective-C answers are fine of course)

        UIGraphics.PushContext (ctx);
        SizeF shadowSize = new SizeF (0f, -3f);
        ctx.SetRGBFillColor (194f / 255f, 212f / 255f, 238f / 255f, 1f);
        ctx.SetAllowsAntialiasing (true);
        ctx.SetShadowWithColor (shadowSize, 20, new CGColor (0.9f, 0.7f));
        RectangleF area = new RectangleF (35f, 15f, 210f, 210f);
        ctx.FillEllipseInRect (area);
        UIGraphics.PopContext ();

Then I want to add to it an arc and lines. When I do, the colors and shadow etc seem to stick around? How do I ‘start fresh’ while drawing my UIView ? (It’s all in the same UIView; I am building up the image)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:48:33+00:00Added an answer on May 13, 2026 at 12:48 pm

    If you mean to clear everything that’s drawn so you have a blank canvas, try CGContextClearRect before drawing anything.

    But I think you mean that you want the shadow, fill color, etc. to only apply to that ellipse and not to the things that you draw afterward. To do that, you want to call the same state-setting methods again, but with different arguments. For instance, CGContextSetShadowWithColor expects a shadow color. But if you pass NULL for that argument, it will disable shadowing.

    See also the CGContextSetShadow documentation, which has a note about all the ways you can disable shadowing. Pick the best one for you.

    I think your main problem is that you’re not taking advantage of Apple’s excellent documentation. I gather that MonoTouch.net essentially maps Objective-C APIs to .NET modules with similar or identical symbol names. So with a quick Google search, you should be able to find the corresponding documentation in the iPhone OS Reference Library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 302k
  • Answers 302k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you aren't seeing a WM_SHOWWINDOW notification, then your window… May 13, 2026 at 8:22 pm
  • Editorial Team
    Editorial Team added an answer You want a dict, which is Python's associative data structure,… May 13, 2026 at 8:22 pm
  • Editorial Team
    Editorial Team added an answer Silverlight still doesn't support implicit DataTemplates :-( The best you… May 13, 2026 at 8:22 pm

Related Questions

I am creating a game where I want to determine the intersection of a
I would like to create a custom control in my Android App. It will
I'm creating a web application in which teachers need to be able to easily
Given a point (pX, pY) and a circle with a known center (cX,cY) and
In my DB i store a center point, along with a radius (in meters).

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.