SketchPad - Doodle On The Go

The colorpicker is actually a Canvas, with a background image of the color spectrum. To pick the color, get the background pixel color at a given point (x,y).

My implementation is pretty complex (in order to allow for implementation of other related features in the future), and also a kind of trade secret, so I will not share the exact details.

However, here is a basic look at how it is done:

  1. Keep track of all Canvas drawing events.
  2. To undo the last event, do the converse of the last event (for a line draw, that would mean drawing a line with paint color the same as background color).
1 Like

This post was flagged by the community and is temporarily hidden.

1 Like

In addition, another solution is to save the image that the canvas displayed then load it from the storage (slower).

2 Likes

But easier to implement. I saw a new drawing app pop up in the Community a couple days back that used this technique. I don’t know if it’s directly caused by the technique, but Undoing has white flashes when the Canvas fully reloads, in said app. In SketchPad there will be a slight delay for larger sketches, but no inconsistencies (or at least I hope so).

Maybe I should add this: The way I implemented Undo, it will enable some extra future features. :wink: It’s not limited to merely removing the last stroke.

1 Like

The way you stop the application for a while

The greater the number of drawing, the application may stop

I had to make a short interval to minimize this

2 Likes

Happy birthday, SketchPad! :tada:


SketchPad is now 2 years old, and going strong! :smile:
What better birthday gift, than…

100K Lifetime Installs! :inbox_tray:

Yes, that’s right! SketchPad has reached this awesome milestone right on its second birthday! :smiley:


I’m stoked, to say the least. I never thought I’d come this far. Feel free to ask me anything about this. :slight_smile:

And as always,
Happy Koding!

15 Likes

Happy Birthday. :partying_face: :+1: :birthday: :cake: :clinking_glasses:

6 Likes

Super App.

1 Like

The app is really awesome man… :star_struck: :star_struck: :star_struck:

2 Likes

This problem (Precision drawing problem in Canvas) also exists in your application.

1 Like

Yes, it does. In fact, I am ditching the built-in Canvas component for this reason alone.

3 Likes

So what do you think are the ways to solve this problem?

1 Like

As I said, the solution I arrived at is to not use the Canvas component.

1 Like

Is there a way to draw without using canvas?

1 Like

It is possible to create a custom canvas via extensions.

1 Like

I’m so sorry to tire you out, but I have to ask. Do you know of an extension for it?

1 Like

I’m sorry but the extension I am using ended up not being publicly released, and the developer halted work on it. He very kindly gave me permission to use the testing version, but I can’t of course share it. I must say, just like you I am looking forward to a better built-in canvas without the jitters and precision issues. :slight_smile:

5 Likes

Maybe any @ExtensionDevelopers is interested to make a better canvas extension :grin:

3 Likes

Good Idea :thinking: Will have a look

2 Likes

Gr8 Idea, Starting

4 Likes