BBC BASIC for Windows
« FILL (replacing a colour at specific location) »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:53pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: FILL (replacing a colour at specific location)  (Read 340 times)
michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
question FILL (replacing a colour at specific location)
« Thread started on: Nov 6th, 2016, 11:32pm »

I could be wrong, but I find that if I FILL a location that has a color other than black, it wont fill the area with the new color.

Is there a way to force it to fill until it reaches a different color, or is there another way?

If FILL doesn't work that way, then I will work on a PAINT tool that does that.
User IP Logged

I like making program generators and like reinventing the wheel
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
question Re: FILL (replacing a colour at specific location)
« Reply #1 on: Nov 7th, 2016, 08:40am »

Hi Michael,

The manual says "performs a 'flood fill' in the current graphics foreground colour, starting at the specified point and continuing until non-background-colour pixels are found"

In other words, if your background colour is black, it will only fill black pixels.

If you change the background colour to the colour you are trying to fill over, it should work: here's an example
Code:
      MODE 21
      GCOL 1
      RECTANGLE FILL 100,100,500,200
      GCOL 4
      RECTANGLE 100,500,500,200
      GCOL 2
      FILL 200,600
      WAIT 100
      GCOL 3
      REM This should fail
      FILL 200,200
      REM But this should work....
      GCOL 128+1   :REM Set background to the red of the bottom rectangle
      GCOL 7
      FILL 200,200
 

If you don't know in advance what colour it will have, you could check with POINT.

Best wishes,

D
User IP Logged

michael
Senior Member
ImageImageImageImage


member is offline

Avatar




PM


Posts: 335
question Re: FILL (replacing a colour at specific location)
« Reply #2 on: Nov 7th, 2016, 09:21am »

I see what I was doing wrong. Thanks..

I will work on this.
It will require using TINT since I am using palettes.
User IP Logged

I like making program generators and like reinventing the wheel
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
question Re: FILL (replacing a colour at specific location)
« Reply #3 on: Nov 7th, 2016, 11:06am »

Yes, you may need to use TINT to get the physical colour, then map that to a logical colour, and set it as the background.

D
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls