Flood Fill Extension. Fill area of an image with a color

Hello friends,

  • Fill an area of ​​an image with a color.

  • The image file must be in the SdCard (root or folder). Example: file:///mnt/sdcard/kitty.png

  • A Canvas.TouchDown is necessary.

  • Each time the color changes the file:///mnt/sdcard/kitty.png is modified.

p187Ci_extension_rellenar.aia (199.5 KB)

Juan Antonio Villalpando.


Great work Juan :+1:


Supubbbbbbbbb extension …

1 Like

Great work Juan :+1:

1 Like

Genius!!! :smile:

1 Like

Excelente explicación y muy bien aplicado, me gustaría saber si se podría aplicar a un dibujo libre realizado con color de pintura directamente sobre el lienzo?

Draw in Canvas and then save picture.
Load that picture.

1 Like

Muchas gracias

Well done @Juan_Antonio.
Great extension.

Buenas de nuevo Juan Antonio, quería consultarle otra duda con respecto a la extensión. ¿Se puede programar con la extensión de manera que se use como relleno el color de un pincel o de un selector de color, como en aplicaciones tipo Paint o Gimp?
Gracias de antemano

Try with Canvas.GetPixelColor

1 Like

thanks for your suggestions, i used drawshape. i need to refine, but it works.

hello Antonio,
it would be possible to know what method you took to color an area other than "drawshape". I'm trying to color a curve in a graph with a gradient towards transparent.
thanks for your reading.

I used an extension withy Java.

Try La inundación de lona llena un área por Scott Ferguson.

Gradient will be much more difficult

Here an extension about gradient

Is there anyway to not use the SD card file path?

I tried to use false but it didn't work.

You need to give a file path to the image file you want to use with the floodfill extension. Why would you put "false" ?

And what file path do I need to add?

You need to give a file path to the image file you want to use with the floodfill extension