This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

RcCookie
RcCookie presents ...

2020/10/15

Paint 2D

Everybody recently seemed to have created a painting scenario, so I thought I'd give it a try, too.
Click on 'Editing color x" to switch between editing the first and second color (left and right mouse button). "Save" saves the drawn image to a png file that you can find in the scenario folder. All you need to do is open the "Saver" class and uncomment the commented code. Online this breaks the scenario.

Yes, online it does lag whenever you stop painting. That is due to a painting system that copies every pixel from the latest changes into the actual image. It is there to have consistent transparent lines, otherwise holding longer onto an area or moving slower while painting will make the painting look weird.
However, offline this won't lag pretty much at all.

98 views / 21 in the last 7 days

2 votes | 0 in the last 7 days

Tags: mouse demo with-source paint color image

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2020-10-15 11:01:43 UTC Updated for online
Roshan123Roshan123

2020/10/15

Not everyone You , i and DatHeroAndy And its far better then we made
Roshan123Roshan123

2020/10/15

How will i select the color???
DatHeroAndyDatHeroAndy

2020/10/15

Very, very good, but why is there a lag after drawing?
RcCookieRcCookie

2020/10/15

@Roshan123 Just click on it ;-) Or adjust the 4 sliders for RGB and transparency
RcCookieRcCookie

2020/10/15

@DatHeroAndy When you simply draw the shapes onto the painting and the color is somewhat transparent, the color gets darker the longer you hold onto the same place, and that quicker, if the framerate is higher. Also, you can see the steps of the single frames drawing for example a circle because where two half-transparent shapes overlay, they will be darker. To encounter this problem, you first draw onto a different image that is shown above, with full density, but the image is transparent. When you stop drawing, the overlaying image with the changes gets copied onto the real image, pixel by pixel. This lags.

Want to leave a comment? You must first log in.

Who likes this?

DatHeroAndy Roshan123