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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:18:00+00:00 2026-05-24T03:18:00+00:00

I have a simple application that shows the user an image (in a UIImageView)

  • 0

I have a simple application that shows the user an image (in a UIImageView) whereby they touch on a part of the screen and then on the next screen the same image is shown (in a UIImageView) but now has a “signature” overlayed on it. The issue I am having is that it seems that the x,y coordinates returned from the touches do not seem to map properly on the UIImageView on the second screen.

For instance when I touch the bottom of the screen I get: X: 157.000000 Y: 358.000000

but the bottom of the screen should be 480 ? since my screen dimensions are: SCREEN HEIGHT AND WIDTH AT X: 320.000000 Y: 480.000000. This causes the signature to be placed at a DIFFERENT spot than what the user intended.

I use the following code to get my touch coordinates:

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{

    NSLog(@"TOUCH HAPPENED");
    UITouch *touch = [touches anyObject];
    CGPoint touchCoordinates = [touch locationInView:self.view];
    NSLog(@"X: %f   Y: %f",touchCoordinates.x, touchCoordinates.y);

}

I am using the following code to place the “signature” with the values I get from the touch:

CGRect screenRect = [[UIScreen mainScreen] bounds]; 
        UIGraphicsBeginImageContext(screenRect.size);


        [pageImage drawInRect:CGRectMake(0, 0, screenRect.size.width, screenRect.size.height)]; // this is the original image

        NSLog(@"SCREEN HEIGHT AND WIDTH  AT   X: %f   Y: %f",screenRect.size.width, screenRect.size.height);


        NSLog(@"PLACING IT AT TOUCH COORDINATES  X: %f   Y: %f",sigLocation.x, sigLocation.y);
        UIImage *shieldLogo = [UIImage imageNamed:@"shield_bw.gif"];
        [shieldLogo drawInRect:CGRectMake(sigLocation.x, sigLocation.y, shieldLogo.size.width/2, shieldLogo.size.height/2)];
        [theSignature drawAtPoint:CGPointMake(sigLocation.x+24.000000, sigLocation.y) withFont:[UIFont fontWithName:@"Arial" size:8.0]];
        [theSignature2 drawAtPoint:CGPointMake(sigLocation.x+24.000000, sigLocation.y+ 8.000000) withFont:[UIFont fontWithName:@"Arial" size:8.0]];

        UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        [image setImage:resultingImage];
  • 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-24T03:18:01+00:00Added an answer on May 24, 2026 at 3:18 am

    The issue might be with the view that the user is touching. You might try (as seen in this link)

    UITouch * touch = [touches anyObject];
    CGPoint pos = [touch locationInView: [UIApplication sharedApplication].keyWindow];
    NSLog(@"Position of touch: %.3f, %.3f", pos.x, pos.y);
    

    This should give the location of the touch relative to the screen.

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

Sidebar

Related Questions

I have simple application, that shows list of many items, where user can display
I have a simple HTML (as HTA) application that shows strange behavior on Windows
I have a simple Desktop Facebook application that allows the user to retrieve some
I am using PHP and Smarty. I have a simple application that: Shows page
i have an application that shows a simple square polygon represented on a GLSurfaceView.
I have a Android application that requires a splash screen. I have a simple
I have a simple application that loads an unmanaged dll and passes a few
I have a simple c++ application that generates reports on the back end of
I have a simple WPF application that uses ClickOnce to handle installing. Within this
I have a simple iPhone application that is very similar to the Page Control

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.