A lightweight, beginner-friendly paint application built with C# and Windows Forms, letting you draw freely on a canvas with customizable colors and brush thickness.
Simple Paint is a desktop drawing app where users can sketch freehand on a canvas using the mouse. It supports color selection, adjustable brush thickness, an eraser tool, background color changes, and the ability to save or open images — all through a clean, easy-to-use interface.
- 🖌️ Freehand drawing on canvas using mouse movement
- 🎨 Quick color selection (Black, Red, Blue, Green)
- 🌈 Custom color picker via
ColorDialog - 📏 Adjustable brush thickness via a slider (
TrackBar) - 🧽 Toggleable eraser mode
- 🗑️ Clear canvas button
- 🖼️ Background color selection
- 💾 Save drawing as a PNG image
- 📂 Open an existing image onto the canvas
- ✨ Smooth, anti-aliased strokes with rounded line caps and joins
- C#
- Windows Forms (WinForms)
- .NET Framework 4.8
- GDI+ (
System.Drawing)
- Program.cs — Application entry point; initializes and runs the main form.
- Form1.cs — Core logic of the app: drawing, color/thickness handling, eraser, clear, save/open functionality.
- Form1.Designer.cs — Auto-generated layout and control definitions for the main form.
- Form1.resx — Resource file associated with the main form (e.g., embedded UI resources).
- Properties/Resources.resx / Resources.Designer.cs — Strongly-typed resource class exposing embedded assets (e.g., the app icon bitmap).
- Properties/Settings.settings / Settings.Designer.cs — Application settings scaffold generated by Visual Studio.
- AssemblyInfo.cs — Assembly metadata (title, version, GUID, etc.).
- App.config — Runtime configuration specifying the target .NET Framework version.
- paint.ico — Application icon.
- SimplePaint.csproj — Project file defining build settings and included files.
- SimplePaint.sln — Visual Studio solution file.
- images/ — Folder for README screenshots.
- Make sure you have Visual Studio installed with the .NET desktop development workload.
- Clone or download this repository.
- Open SimplePaint.sln in Visual Studio.
- Press F5 (or click Start) to build and run the application.
- Start drawing on the canvas with your mouse!
This project demonstrates the following Windows Forms and .NET concepts:
- Event-driven programming (button clicks, mouse events, scroll events)
- GDI+ drawing with
Graphics,Pen, andBitmap - Handling
MouseDown,MouseMove, andMouseUpevents to implement freehand drawing - Using a
PictureBoxas a drawing surface ColorDialogfor custom color selectionOpenFileDialogandSaveFileDialogfor file I/OTrackBarcontrol for adjustable values- Anti-aliasing and line cap/join settings for smoother visuals
- Drawing is done onto a persistent
Bitmap(not directly on the control), ensuring strokes are preserved and redrawn correctly when the form refreshes. SmoothingMode.AntiAliascombined with roundedLineCapandLineJoinsettings gives strokes a smooth, continuous look instead of jagged segments.- Eraser mode reuses the drawing logic by simply switching the active color to the canvas background color.
- Opening an image loads it into a new bitmap and stretches it to fit the canvas dimensions before displaying it.
- Shape drawing tools (rectangle, ellipse, line)
- Undo / Redo functionality
- Keyboard shortcuts for common actions
- Export to additional image formats

