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 8737735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:35:28+00:00 2026-06-13T10:35:28+00:00

Is it possible for a user to draw a dotted line (in a circle)

  • 0

Is it possible for a user to draw a dotted line (in a circle) around the bit of the UIImageView they wish to crop to, and then for the UIImageView to resize to those points? It’s a bit like the lasso/marquee effect in Photoshop:

enter image description here

  • 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-06-13T10:35:29+00:00Added an answer on June 13, 2026 at 10:35 am

    Update: Since iOS 8.x, UIImageView provides a maskView property. Just prepare an image with some opaque pixels, create another image view with that mask image, and set this mask image view as the maskView. The opaque pixels in the mask image will be the ones shown in the underlying image.

        UIImageView *maskView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"somemask"]];
        maskView.frame = imageView.bounds;
        imageView.maskView = maskView;
        // imageView will be masked by maskView
    

    .

    Original Answer

    There’s quite a bit to do, but here’s a high-level outline:

    1. create an empty image which will become a mask
    2. build a path in that image from user input
    3. fill the path to turn it into a mask
    4. apply the mask to the imageview’s image

    Create image: A simple idea here is to just ship a black image with your project. It should be sized to match the maximum region a user can select. Read the image into memory (UIImage imageNamed:) and set it up as the drawing context by calling UIGraphicsBeginImageContext.

    Create path: (see apple docs). When the user starts stroking the region, call CGContextBeginPath, then follow user gestures, sampling the touches and adding small segments by calling CGContextMoveToPoint repeatedly as touchesMoved.

    Create mask: To turn the path into a mask you want a black background and the path filled with white. If you started with a black image, you just need to do the fill. See the same apple guide about doing that.

    Finally, you’ll apply this mask to your imageView’s image. Here’s a decent reference for that.

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

Sidebar

Related Questions

Possible Duplicate: Android How to draw a smooth line following your finger I'm new
My requirements: A user should be able to draw something by hand. Then after
Possible Duplicate: User control javascript I defined a JavaScript function inside a user control.
Is it possible to let user enters a path with quotes in JFileChooser and
Is it possible for a user control to determine its context or its parent
Is it possible to prevent user from writing letters to a textbox (i.e. force
Is it possible to extend user's session expiration time in CI. What I want
Is it possible for a user other than root to create a database? GRANT
I'm trying to make it possible for the user to download an Excel spreadsheet
When using <input type=file multiple> it's possible for the user to choose multiple files.

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.