This was given as an example in the help file.
Code:
' Change all red pixels to blue LOCAL PixelPtr AS LONG PTR GRAPHIC GET BITS TO bmp$ xsize& = CVL(bmp$,1) ysize& = CVL(bmp$,5) PixelPtr = STRPTR(bmp$) + 8 FOR i& = 1 TO xsize& * ysize& IF @PixelPtr = BGR(%red) THEN @PixelPtr = BGR(%blue) INCR PixelPtr NEXT GRAPHIC SET BITS bmp$
On first guess, it's probably slower than redoing multiple lines but it has the advantage of not having to know anything about the lines except their color.
It also has the advantage that if your "bad" line overlap your "good" lines, you won't see wrongly colored pixels where the bad lines were drawn over good lines (necessitating a redraw of the good lines).
Leave a comment: