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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:51:41+00:00 2026-06-01T22:51:41+00:00

I have a color map within a UIScrollView and am trying to sample the

  • 0

I have a color map within a UIScrollView and am trying to sample the color of a pixel of this map. The sample reticle is positioned above the scrollview, while the user moves the contents of the scrollview under the reticle.

The user can drop the reticle with a tap gesture, but I would like to offer an extra option of moving the view under the reticle.

I’m trying to find out how I can understand what x,y coordinate of the zoomed view is currently under the reticle. The logic for this so far eludes me, especially since zooming in/out is involved.

-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{

    CGPoint mapLocation = [tapGestureRecognizer locationInView:self.surfaceMap];

     NSLog(@"mapLocation (x,y) %.0f,%.0f",mapLocation.x,mapLocation.y);

    NSLog(@"contentOffset (x,y) %.0f,%.0f",self.scrollView.contentOffset.x,self.scrollView.contentOffset.y);

    //calculate where the marker is pointing to in the surface map while the scrollview is scrolling

    int frameWidth = self.surfaceMap.frame.size.width;
    int frameHeight = self.surfaceMap.frame.size.height;

//this is what I'm trying to calculate
    CGPoint trueLocation = CGPointMake(self.scrollView.contentOffset.x+frameWidth-self.surfaceMap.frame.origin.x, self.scrollView.contentOffset.y-self.surfaceMap.frame.origin.y);
    NSLog(@"trueLocation (x,y) %.0f,%.0f",trueLocation.x,trueLocation.y);

    [self colorOfPixelAtPoint:trueLocation];

}

Any input is appreciated!

  • 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-01T22:51:43+00:00Added an answer on June 1, 2026 at 10:51 pm

    You may want to a have look at these two methods in UIView:

    - (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;
    - (CGPoint)convertPoint:(CGPoint)point fromView:(UIView *)view;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty big number of photos and a RGB color map (let's
See,I have this code: template<typename T=int>struct color { T red, green, blue; color(T r,
I have plotted a contour map but i need to make some improvements. This
I have two controls which are both contained within a user control. Panel location:
I have a map of pre-defined colors and a given color to select one
We have this map, we need to use PHP to take all the shades
I have an openlayers map and I have positioned a div to sit inside/over
I have created a 3d map using rgl.surface(), mainly following Shane's answer in this
I have 4 textures used in a multi-pass effect with the color map at
I have four integer values (0 - 255) for an ARGB color map. Now

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.