Hi
I have an application which draws simple polygons in white on a black background - in the example below a triangle in which one vertex has a pretty small angle - and then colours the interior of the triangle in a colour (here yellow) using fill_to_border@. Whilst on screen it quite often appears fine (though sometimes you can see uncoloured dots) when one interrogates the actual colours near the 'sharp point' one finds that two or three pixels within the triangle have not in fact been coloured (and in the code below remain black).
I am using the colours to represent results (on a virtual screen) and thus it is essential that all pixels within any triangle are correctly coloured. I could obviously develop my own crude colour routine or do a complete scan of the pixel map to spot and correct any pixels that are not correctly coloured but any other ideas would be appreciated. [In the code below the 'mat' array output has two zero (black ie uncoloured) pixels within the triangle near the point]
Many Thanks
Bill
program fill_error
INCLUDE <WINDOWS.INS>
integer*4 ictrl1,ix,iy,jx,jy,iwhite,iyellow,kol
character*30 screentitle
character*1 mat(20,20)
dimension ix(4),iy(4)
c c set up graphics window c screentitle = 'fill_to_border problem' iwiw = winio@('%ca@&',screentitle) iwiw = winio@('%`gr&',600L,600L,1L) iwiw = winio@('%lw',ictrl1) call select_graphics_object@(1L) call use_rgb_colours@(1L,1L) c c set colours c iwhite = rgb@(255L,255L,255L) iyellow = rgb@(255L,255L,0L) c c colour it white c call draw_filled_rectangle@(1L,1L,600L,600L,0L) call perform_graphics_update@ c c set values for points of triangle and draw it c ix(1) = 15 ix(2) = 156 ix(3) = 15 ix(4) = 15 iy(1) = 240 iy(2) = 428 iy(3) = 146 iy(4) = 240 call draw_polyline@(ix,iy,4L,iwhite) call perform_graphics_update@ c c set values for inner point and fill triangle c jx = 72 jy = 293 call fill_to_border@(jx,jy,iyellow,iwhite)
c
c get the colours near the sharp point and represent by
c characters in matrix 'mat'
c 0 = black, . = white, * = yellow
c
open(7,file='matrix.txt')
do 10 jx = 137,156
do 20 jy= 409,428
i = jx - 136
j = jy - 408
call get_rgb_value@(jx,jy,kol)
if(kol .eq. 0L)mat(i,j) = '0'
if(kol .eq. iwhite)mat(i,j) = '.'
if(kol .eq. iyellow)mat(i,j) = '*'
20 continue
write(7,1)(mat(i,j),j=1,20)
1 format(20a1)
10 continue
close(7)
end

