MImgCtlGetImagePixFromPoint
bOk = MImgCtlGetImagePixFromPoint( hWndCtl, nX, nY, nrImgX, nrImgY )
bOk = CMImgCtl.GetImagePixFromPoint( nX, nY, nrImgX, nrImgY )
Gets the image's pixel from a given point of an image control.
Parameters
hWndCtl
Window Handle: Window Handle of the image control.
nX
Number: X coordinate in pixels relative to upper left corner of the image control.
nY
Number: Y coordinate in pixels relative to upper left corner of the image control.
nrImgX
Receive Number: X coordinate of the image pixel.
nrImgY
Receive Number: Y coordinate of the image pixel.
Return
Boolean: TRUE if successful or FALSE if the given point is outside the image or an error occured.
Example
In this example the color of the clicked image pixel is determined:
CMImgCtl: ccImg
...
Message Actions
On WM_LBUTTONDOWN
If MImgCtlGetImagePixFromPoint( hWndItem, SalNumberLow( lParam ), SalNumberHigh( lParam ), nImgX, nImgY )
Set nColor = MImgGetPixelColor( MImgCtlGetImage( hWndItem ), nImgX, nImgY )
If nColor != MIMG_COLOR_UNDEF
sMsg = "The color of the clicked image pixel is " || SalNumberToStrX( nColor, 0 )
Else
sMsg = "Error getting pixel color"
Else
sMsg = "Click was outside the image."
Call SalMessageMox( sMsg, "Click info", MB_IconAsterisk | MB_Ok )
Created with the Personal Edition of HelpNDoc: Easily create EPub books