Re: ? How to get the pixel color without relying on mouseColor

2003-08-14 Thread David Bovill
On Sun, 2003-08-10 at 14:02, Sparticus Zarris wrote:

> Please, don't tell me to write a function like this:
> 
> function convolutedGetPixelColor  aPoint
>   set the screenMouseLoc to aPoint
>   get the mouseColor
> 
>   return it
> 
> end convolutedGetPixelColor

Oh go on - let me :)

Not done it - but thought that you'd need to use a combination of...
using the imagedata property and working out the dimensions of the image
(the tricky bit). You can get the original dimensions of the image using
the formattedHeight/Width and there is also some feature I could not
find in the MC documentation which returns the dimensions of the data
returned by the imagedata.

function convolutedGetPixelColor  apoint, imageName
  -- something like this ???
  put the imageData of image imageName into someImageData
  put the formattedWidth of image imageName into oWidth
  -- put the formattedHeight of image imageName into oHeight
  
  put (item 1 of apoint) * 8 into endChar
  put endChar - 8 into startChar
  
  put item 2 of apoint into lineNum
  put (lineNum - 1) * 8 * oWidth into extraBit
  add extraBit to startChar
  add extraBit to endChar

  - now you should have the 8 
  
end convolutedGetPixelColor

Hope you get the principle - I have some functions on another machine
that work with imagedata if you are still stuck?

david

___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard


? How to get the pixel color without relying on mouseColor

2003-08-14 Thread Sparticus Zarris
It seems unusual that there is a function to get the color of 
the pixel under the mouse, but no function to get the color 
of an arbitrary pixel.

I'm _sure_ there must be something like:

get the color of pixel 240,360

which would put the triplet "0,0,0" into it, if (240,360) is a 
black pixel, or "255,255,255" into it if (240,360) is a white 
pixel.


Please, don't tell me to write a function like this:

function convolutedGetPixelColor  aPoint
  set the screenMouseLoc to aPoint
  get the mouseColor

  return it

end convolutedGetPixelColor


Why would this be stupid?  Obviously, because if I need to 
iterated over a _Large_ range of pixels, the user might get 
worried something had gone wrong, and bump/wiggle his 
cursor to see if the computer had frozen.

Having wiggled the cursor, he just set the mouseLoc to a 
different Loc halfway through my giant repeat loop that 
checks all the pixels.

So, please tell me I'm missing some function that does 
"the Right Thing", and not that mouseColor & 
screenMouseLoc is the _wonderful_ "Meta" way of doing it.
 
 
 
Sparticus Zarris
1208 Clark Street
New Albany, Indiana  47150
[EMAIL PROTECTED]
(812) 944-1042  phone

--
Aye Net WebMail 2.0
http://www.aye.net/getmail
___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard