Skip to content

Simple drawing app made in winforms that supports layers.

License

Notifications You must be signed in to change notification settings

nikoladevelops/drawably

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drawably - simple drawing application

This is a practice application and you are free to do whatever you like with it. It is heavily inspired by Paint.NET .
I do not own any of the icons used so you should check out the credits.txt file.

Technlogies used: Windows Forms with .NET 6

image

Supported features:

Draggable windows

Available windows: Colors Window, Layers Window and Tools Window. They are all draggable and you can also hide/show them.

Layers

Layers support Z index ordering.
How does it work?
Each layer is just a bitmap. I also have a displayed image bitmap which is basically all layer bitmaps merged into a single one and then displayed on the canvas. The Z index ordering relies on the ordering of the labels inside the Layers Window. There are lots of small details like when do you update the displayed image, how do you ensure that you are drawing on the selected layer at all times and so on.. but I'm fairly confident that the code documentation is enough to figure it out.
Functionality:
  • Create New Layer
  • Delete Layer
  • Duplicate Layer
  • Move Layer Up
  • Move Layer Down
  • View/Hide Layer

Colors

Functionality:
  • Left Color
  • Right Color
  • Switching left and right color
  • Color opacity

Tools:

Select Shape Tool
Allows you to select generated shapes and move them around the screen.
Pen Tool
Allows you to draw with a brush size of 1px.
Brush Tool
Allows you to draw with a chosen brush size.
Draw Shapes Tool
Allows you to easily generate shapes with a given width and height. Supported shapes are: Rectangle, Circle, Normal Triangle and Right Triangle.
Zoom In Tool
Allows you to zoom in on the canvas. Hotkey: CTRL + MOUSE SCROLL WHEEL UP.
Zoom Out Tool
Allows you to zoom out on the canvas. Hotkey: CTRL + MOUSE SCROLL WHEEL DOWN.

Canvas:

The canvas supports resizing.

Known Issues:

  • Performance is a big Issue, especially when the canvas is zoomed in fully. This is because of the Graphics.DrawImage() method that also handles scaling internally.
  • Scroll bars are not re-positioned correctly upon resizing.
  • Sometimes when resizing the mouse coordinates don't match the graphics' coordinates which causes wrong mouse position drawing (fixed if you resize a couple of times).
  • Lots of useful features missing - fill color bucket tool, color picker, text rendering, layer re-naming, different image export formats, saving the project on disk and being able to return to it any time you would like, rotating shapes, being able to copy/paste images from clipboard, history for all changes applied to the canvas and much more..

This was a practice project so I don't plan on improving it. In the first place using Windows Forms for a drawing application is a bad idea, because GDI+ is not hardware-accelerated, not to mention that you can only run the app on Windows. Still, it was a fun little challenge to tackle.