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

  • SEARCH
  • Home
  • 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 8329981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:58:25+00:00 2026-06-09T01:58:25+00:00

I am working on some image processing project where I need to implement eraser

  • 0

I am working on some image processing project where I need to implement eraser on a image. I have to also implement pinch effect to scale the image smaller or larger. Pinch is working nice. Eraser also works perfect If I dont scale the image by pinch. But when I use pinch and then use eraser. The image goes blur. I have implemented eraser on UIPanGestureRecognizer.

Below is the code for eraser.

CGPoint translatedPoint = [(UIPanGestureRecognizer*)sender locationInView:tattooImage];
if([(UIPanGestureRecognizer*)sender state] == UIGestureRecognizerStateBegan)
{
     lastPoint = translatedPoint;
     //lastPoint.x += 60;
     //lastPoint.y += 60;
}
else
{
     CGPoint currentPoint = translatedPoint;
     //currentPoint.x += 60;    
     //currentPoint.y += 60;

     UIGraphicsBeginImageContext(tattooImage.frame.size);
     [tattooImage.image drawInRect:CGRectMake(0, 0,tattooImage.frame.size.width, tattooImage.frame.size.height)];
     CGContextSetBlendMode(UIGraphicsGetCurrentContext( ),kCGBlendModeClear);
     CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
     CGContextSetLineWidth(UIGraphicsGetCurrentContext( ), 25.0);

     CGContextSetStrokeColorWithColor(UIGraphicsGetCurrentContext(), [[UIColor clearColor] CGColor]);
     CGContextBeginPath(UIGraphicsGetCurrentContext());
     CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
     CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
     CGContextStrokePath(UIGraphicsGetCurrentContext()) ;

     tattooImage.image = UIGraphicsGetImageFromCurrentImageContext();
     UIGraphicsEndImageContext();

     lastPoint = currentPoint;
}

Please provide any help. Thanks in advance.

  • 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-09T01:58:28+00:00Added an answer on June 9, 2026 at 1:58 am

    I found the solution. There is a small change which I did and I got the desired result. I changed tattooImage.frame.size with tattooImage.bounds.size everywhere in the code, and It worked perfectly. Thanks to https://stackoverflow.com/users/1389202/pete-c

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

Sidebar

Related Questions

i am working on a project which requires some image processing, i also asked
I am working on a project that requires some image processing. The front end
I am working on some image processing and I am in need for the
I am writing a program to do some image processing. I am working with
I have been working on some code to submit an uploaded image to PHP
I have been working on a website that has some images that I need
I'm working with an image processing project where I'm trying to locate features on
I'm working on a project that's trying to implement some editing features using a
I'm working on some image processing and for debug I'm overlaying colours on the
I'm trying to get some image processing code working in MS VC++ 2010 express.

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.