Wednesday, March 18, 2020

Canvas Paint

Here is another small JS project that I built quite a few years ago.  It was basically just an exploration of the canvas tag, which was somewhat new at the time.  I called it "Canvas Paint".  It allows you to draw on the canvas.  You can change the color and width of the brush by changing the numbers in the boxes and clicking either "Set Color" or "Set Width".

When you're done drawing you can click "Get Image".  This gets the base64 source of the image from the canvas and sets it as the src of an image tag at the bottom of the page so you can download the image.

There are various other controls that allow you to adjust the color of your whole image in various ways.  You can see the code below that shows what all these controls do.

No comments:

Post a Comment


  I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way. Basically, any progra...