[comp.sys.amiga] ReadPixel

ahinds@hvrunix.UUCP (Alexander Hinds) (01/25/88)

	I've been writing a program which steals the current view from
Intuition via GfxBase->ActiView, then gets a pointer its bitmap via
View->ViewPort->RasInfo->BitMap and then assigns this bitmap to a       
RastPort structure. (myRast->BitMap)  I then try to use ReadPixel to
determine the colors of the bitmap at a particular location.  For example
ReadPixel(&myRast,10,30).  However, it always gurus.  The two I get are:
	1.)0000000c	: Address out of range.  But I don't understand how
this can be since I check the dimension of the original viewport view
View->ViewPort->DHeight and DWidth.
	or:
	2.)0000000?	: Op code 1111.
Could anybody please tell me what I'm doing wrong?  I even tried putting a 
Forbid() Permit() around the block of code that reads the pixel info to 
prevent anybody from changing the bitmap.

	On a second note, is there a way to find out when the last key
was hit on the keyboard, especially if your process was not active at the
time?  In other words, I need to know if a user is interactively running the
computer, or if its just idling, and if so, how long ago it started idling.

	Any and all help would be *greatly* appreciated.  I thank you in
advance.

					Sincerely,
						Alexander Hinds

USENET:ahinds@hvrford
BITNET:A_HINDS@HVRFORD