FIX: FLOODFILL Fails to Fill to the Boundary ColorLast reviewed: September 11, 1997Article ID: Q71184 |
5.00 5.10
MS-DOS
kbprg kbfixlist kbbuglist kbcode
The information in this article applies to:
SYMPTOMSPrograms compiled with Microsoft FORTRAN version 5.0 or 5.1 for MS-DOS that use the FLOODFILL graphics function may fail to fill an area to the boundary color. The FLOODFILL function may stop filling an area when it encounters the fill color, instead of the boundary color.
RESOLUTIONTo avoid this problem, remap the index of the fill color to a different color index using the REMAPPALETTE function. This method allows the FLOODFILL function to successfully fill over the existing fill color, right to the edge of the boundary color.
STATUSMicrosoft has confirmed this to be a problem in Microsoft FORTRAN versions 5.0 and 5.1 for MS-DOS. This problem was corrected in FORTRAN PowerStation.
MORE INFORMATIONThe following example program illustrates the problem:
INCLUDE 'FGRAPH.FI' INCLUDE 'FGRAPH.FD' INTEGER*2 dummy dummy = setvideomode($MAXRESMODE) dummy = setcolor(7) ! White for rectangle border dummy = rectangle($GBORDER, 100, 100, 200, 200) dummy = setcolor(2) ! Green to fill rectangle read (*,*) dummy = floodfill(120, 120, 7) ! Fill to White border read (*,*) dummy = setcolor(4) ! Red for 2nd rectangle border dummy = rectangle($GBORDER, 125, 80, 175, 250) dummy = setcolor(2) ! Green to fill 2nd rectangle read (*,*) dummy = floodfill(150, 90, 4) ! Fill to Red border read (*,*) dummy = setvideomode($DEFAULTMODE) ENDRemapping a different color index to the fill color before calling FLOODFILL the second time will prevent the problem from occurring. The following program illustrates this solution:
INCLUDE 'FGRAPH.FI' INCLUDE 'FGRAPH.FD' INTEGER*2 dummy dummy = setvideomode($MAXRESMODE) dummy = setcolor(7) ! White for rectangle border dummy = rectangle($GBORDER, 100, 100, 200, 200) dummy = setcolor(2) ! Green to fill rectangle read (*,*) dummy = floodfill(120, 120, 7) ! Fill to White border read (*,*) dummy = setcolor(4) ! Red for 2nd rectangle border dummy = rectangle($GBORDER, 125, 80, 175, 250) dummy = remappalette(3,$green) ! Remap color index 3 to green dummy = setcolor(3) ! Green to fill 2nd rectangle read (*,*) dummy = floodfill(150, 90, 4) ! Fill to Red border read (*,*) dummy = setvideomode($DEFAULTMODE) END |
Additional reference words: 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |