• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting Pixel Position in an image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting Pixel Position in an image


  • Subject: Getting Pixel Position in an image
  • From: "Anish Kumar" <email@hidden>
  • Date: 21 Dec 2004 07:26:15 -0000

  Hi All,

Can anyone please tell me how to get the "Pixel position" of a pixel that is currently under
the mouse for an image that is displayed in a sub-class of NSView. I know how to get the
current mouse location in the image views co-ordinates, but I can't use this value in my
application for the following reason.

Basically I am developing an annotation feature for my application (Similar to ACROBAT's
annotation feature) and the user can enter their comments/annotation for the image and a
icon will be placed on the location where the annotation was made to the image. Clicking
the icon will display the annotation that was made there.

The problem I face here is:- as long as the image is not zoomed, the annotation icons are in
their correct position. When I zoom the image, the icons are misplaced as I am using the
mouse locations for placing the icons to the image. Now if I use the PIXEL POSITION in the
image instead of the mouse location I can place the annotation icons at the correct pixel
position irrespective of the zoom-level of the image.

So can anyone please tell me how to get the pixel-positions in an image.( something similar
to  Adobe photoshop's INFO window, where they display the X-Y coordinates of the cursor,
that doesn't change for a particular position in the image even if the image is zoomed
(zoom-in or zoom-out) to any level.

thanks in advance,
-Anish



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Getting Pixel Position in an image
      • From: Guy English <email@hidden>
  • Prev by Date: To Draw fine rectangle
  • Next by Date: Creating a Constants.h file
  • Previous by thread: Re: To Draw fine rectangle
  • Next by thread: Re: Getting Pixel Position in an image
  • Index(es):
    • Date
    • Thread