fill tool

Blitz3D Forums/Blitz3D Programming/fill tool

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

hm. I may just use it for referance then. I'm planning to set up files for the images to be filled containing x and y positions for spots within the same lines.

I'm using the bottom example for now though, so I'm just wondering what AlteFarbe and NeueFarbe is? (all I know is that it is some kind of colour thing) I'm kind of guessing right now. Also, when I right click to draw the fill it only fills in a little bit, then I have to drag the mouse to fill more. What am I doing wrong with the function?

;includes
;the flood fill function
Include "FloodFill.bb"

;graphics setup
Graphics 800,600,16,2

;double buffer setup
SetBuffer BackBuffer()

While Not KeyDown(1)

;the line drawing stuff

;uh, me being lazy
CursorX=MouseX()
CursorY=MouseY()
;end me being lazy and not bothering to fix my lame code

If MouseDown(1)
	
	If linebefore=0
		lastmouseX=CursorX
		lastmouseY=CursorY
		linebefore=1
	EndIf

	Line lastmouseX,lastmouseY,CursorX,CursorY
	lastmouseX=CursorX
	lastmouseY=CursorY
EndIf

;flood fill function

If MouseDown(2)
	;lock buffer for speed up
	LockBuffer FrontBuffer()
	flood_fill_now(MouseX(),MouseY(),$ff000000,$ff0000ff)
	;unlock buffer
	UnlockBuffer FrontBuffer()
EndIf

;double buffering
Flip

Wend