Giter Club home page Giter Club logo

Comments (2)

williammalone avatar williammalone commented on July 21, 2024

Hi timo002,

The example code for the bucket tool has two layers: a color layer (where the colors are drawn) and an outline layer (the black and transparent image i.e. the watermelon duck which is not changed). The two layers are stacked on top of each other so that we can draw to the color layer and keep the outline smooth and anti-aliased. The color layer will fill in any contiguous pixels once tapped, but since it starts off empty you would need to draw to the color layer initially. Just create a new variable for the initial color image and assign it an "src" property with the image path and an "onload" property with a function that draws to the context (like the outlineImage in the init function). Note: You will also need to change the outlineImage.onload function since it clears the canvas if it loads after the new onload function.

Let me know if this is what you are looking for and it works for you.

from html5-paint-bucket-tool.

timo002 avatar timo002 commented on July 21, 2024

Hello William,

I can work with this! Thanks!

from html5-paint-bucket-tool.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.