PaintBrush v1.1

PaintBrush is NOT an application, it's a public domain class that can be used in various drawing applications or games.

It's really simple to use. You just set a destination surface and a surface to be used as a brush.

Then you can set the color and alpha value for that brush. You can also tell the brush to be rotated in the drawing direction.

It's also possible to specify a line pattern to be able to draw dotted lines.

About the Demos

The source package includes two different demos of how to use the PaintBrush class.

In the AdvancedDemo.py you can try out all advanced features and in the SimpleDemo.py you can see how easy it is to use the class.

You start them by "python AdvancedDemo.py" and "python SimpleDemo.py".

What's new since v1.0?

The only change is to the help text of the AdvancedDemo.py. I forgot to add that you can use the right mouse button to draw lines.

Screenshot

Related links

  • Python - The python programming language.
  • PyGame - Game development for Python.

Downloads

Copyright notice

  • This code is Public Domain.

Comment this project:

Your name:
Your email (hidden):
Message:
Enter the validation code :
Private! (visible for webmaster only)

Rick Gibson 2010-03-12 15:45:36

Great program thanks for spending the time to develop this application.
The python demos were really a nice surprise.

Only wish the application had an easy way to draw shapes.
Still looking for a Kolourpaint replacement don't want to install the heavy KDE library.

Answer:

Hi,

It's really not that hard to implement shapes.
As long as you can get the shape into separate points you can always use the paint_from (for the first point) and paint_to (for the rest of the points) to draw that shape.

If I can find the time I'll try to add a demo showing this as well.

Best Regards
/John Eriksson

master chief 2009-12-17 04:19:38

suggestions or tips would be greatly appreciated

master chief 2009-12-17 04:18:24

my program has to be very simmilar to this, only mine must have a theme. I also need stickers from that theme which can be applided to the drawing. Im thinking of doing a modern warfare 2 theme

master chief 2009-12-17 04:14:26

how do you get a spray paint effect

master chief 2009-12-17 04:13:10

im making a paint program for my comp sci class(python) got any ideas