Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

floodfill function that can fill certain area of bufferedimage

does anyone know a function that would fill a colour in a BufferedImage like in ms paint the paint bucket. If not function that already does this in Java does anyone no what would do to go about writing one. Just a function that fills colour when given x,y co-ords that would be gotten from mouse click. Just has to work basicly the same as paint bucket in ms paint but in java applet. I've seen some examples on web but can't seem to get to work. I just want function in format of something like floodFill(int x, int y, Color oldColour, Color newColour). please help!!
0
mac1416
Asked:
mac1416
  • 3
  • 3
1 Solution
 
mac1416Author Commented:
how do i use that to fill a certain area of a picture. I want to be able to use it with any image or drawing user has drawn. How would i write a function that when the user clicks a certain point on the image it fills everything around it that is the same colour as the point clicked and if not doesnt fill that pixel.
0
 
mac1416Author Commented:
how whould I get the shape of the area to be filled so i could use public abstract void fill(Shape s)? if thats possible.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
CEHJCommented:
>>How would i write a function that when the user clicks a certain point on the image it fills everything around it that is the same colour as the point clicked and

Not sure off-hand. I've never seen that functionality in a graphics program btw.

>>how whould I get the shape of the area to be filled

You'd have to define that shape in some way. In graphics packages, this is normally done with selection.
0
 
mac1416Author Commented:
it's ok i've finnally written a function that does what i want. thanks for help anyway.
0
 
CEHJCommented:
Well done. Thanks ;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now