Skip to content

Example to paint on a screen with the Slint GUI using (tiny) Skia.

License

Notifications You must be signed in to change notification settings

tfachmann/slint-painter-example-skia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slint Painter Example (Skia)

This repository is a little case-study to implement a painter (canvas) with the Slint GUI Toolkit. The drawn objects are not selectable or changeable, as this approach draws the paths directly to an image buffer via tiny-skia. This is my first contact working with Slint.

Features:

  • 🔧 different brushes: Freehand, Line, Rectangle, Ellipse
  • 💡 path preview
  • 📝 change brush size
  • 🎨 change brush color (not in GUI - color picker missing)
  • 🔄 undo and redo all operations

Annoyances:

  • 💥 fixed dimensions (at creation time)
  • 💥 touch area and displayed paths differ when the window is resized
  • 💥 no operations on individually drawn objects
  • 💥 tiny-skia engine may be slow in the path preview
  • 💥 unclear how to create a reusable slint component out of that 😕

Running

Simply use cargo to run this example

cargo run --release

Preview

screenshot-2024-02-07-130452

About

Example to paint on a screen with the Slint GUI using (tiny) Skia.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages