
-----------------------------------
creepforever
Fri Apr 29, 2016 9:13 am

Paintbucket in paint program doesn't work proper
-----------------------------------
What is it you are trying to achieve?
I'm working on a paint program for my grade 10 paint program.  


What is the problem you are having?
The paintbucket procedure won't fill in the color that I want it to .

Describe what you have tried to solve this problem
I tried making the fill color parameter in the Draw.Fill Procedure a variable which can be assigned a value depending on which color box you click but it won't work.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)






var mx, my, button: int
var premx, premy : int
var pencili: int
var eraseri: int
var paintbucketi: int
var linei: int
var font: int
var clr1, clr2, clr3, clr4, clr5, clr6: int
var n: int



pencili:= Pic.FileNew ("pencil.jpg")
eraseri:= Pic.FileNew ("eraser.jpg")
paintbucketi:= Pic.FileNew ("paintbucket.jpg")
font:= Font.New ("Times New Roman:15")
n:= black
clr1:= 40
clr2:= 52
clr3:= 10
clr4:= 14
clr5:= black
clr6:= 151

setscreen ("graphics: 1200, 640")


procedure pencil 
loop
mousewhere (mx, my, button)
if mx>10 and mx480 and my10 and mx450 and my10 and mx420 and my10 and mx390 and my10 and mx360 and my10 and mx330 and my 70 and mx0 and my110 and my>530 and my 70 and mx0 and my530 and my10 and mx480 and my10 and mx450 and my10 and mx420 and my10 and mx390 and my10 and mx360 and my10 and mx330 and my 70 and mx0 and my530 and my 70 and mx0 and my 70 and mx0 and my530 and my 10 and mx 530 and my 120 and mx530 and my240 and mx540 and my390 and mx545 and my1050 and mx570 and my