websss
asked on
X Y position to array item?
I have an image which is 320x240 px
I have an array of values for each pixel in the image (76,800 points)
If the user hovers over any part of the image I need to look at the array and return the corresponding value for it.
i.e.
X Y position [0,0] of the image = the first value in the array.
If I wanted to find out the X Y position [65,33] of the image, and then look up the value in the array, what would be the correct forumla to do this
I have an array of values for each pixel in the image (76,800 points)
If the user hovers over any part of the image I need to look at the array and return the corresponding value for it.
i.e.
X Y position [0,0] of the image = the first value in the array.
If I wanted to find out the X Y position [65,33] of the image, and then look up the value in the array, what would be the correct forumla to do this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks both
You're welcome, glad to help brother.
Open in new window
Then another function that searches for X/Y in the given array like :
Open in new window
Then call them like :
Open in new window