Guessing if this is my hardware/software rig problem or compiler bug. Please check what color do you get when step with the mouse on vertical line?
module com222
use mswin
implicit none
integer ::hwnd
integer , dimension(4) ::rect
integer ir, ig, ib, iRGBvalue
integer ix, iy, iflags
contains
integer function draw_func()
logical :: dummy
dummy = GetWindowRect(hwnd,rect)
if (.not.dummy) stop
call draw_line@( 0, 100, 200, 100, rgb@(253,0,0))
call draw_line@(100, 0, 100, 200, rgb@(252,0,0))
draw_func = 2
end function draw_func
!.................................................
integer function PixelsPosAndRGB ()
call get_mouse_info@(ix, iy, iflags)
call GET_RGB_VALUE@( ix, iy, iRGBvalue )
ir = and (iRGBvalue,255)
ig = and (rs(iRGBvalue,8),255)
ib = rs (iRGBvalue,16)
call window_update@(ir)
call window_update@(ig)
call window_update@(ib)
call window_update@(ix)
call window_update@(iy)
PixelsPosAndRGB = 2
end function
end module com222
! *******************************************
! * Main Program *
! *******************************************
winapp
program badRGB
use mswin
use com222
implicit none
integer :: ctrl,i
ctrl = 0
i = winio@('%ca[ Find RGB color]&')
i = winio@('%ww Find RGB of vertical red line %2nl%es&')
i = winio@('%sc&',draw_func)
! i = winio@('%mi[icon_1]&')
i = winio@('ir ig ib posX, posY &
&%ff%4rd%4rd%4rd %4rd%4rd%ff&', ir,ig,ib, ix,iy)
i = winio@('%pv%^gr[black, full_mouse_input, rgb_colours]&',200,200, PixelsPosAndRGB)
i = winio@('%mn[&File[E&xit]]&','EXIT')
i = winio@('%lw%hw',ctrl,hwnd)
end program