Draw
FAQ › EUZOS Desktop › Draw · Nederlands
What is it?
Draw (Dutch: Tekenen) is EUZOS's own simple paint program, in the spirit of MS Paint: draw, touch up a screenshot or a photo, add some text, crop, and save as PNG or JPEG. It is in the mega menu (column Tools), and every picture in Files has Open with Draw in its context menu. All code is our own (libs/ui, libs/image): no external software.
How do I…?
Which tools are there?
On the left, top to bottom (with a keyboard shortcut):
| Tool | Key | What it does |
|---|---|---|
| Pencil | P | a hard line of 1 pixel |
| Brush | B | a smooth, anti-aliased round stroke of the chosen size |
| Eraser | E | a hard square of the chosen size in the secondary colour |
| Line | L | a straight anti-aliased line |
| Rectangle | R | outline (thickness = size) or filled |
| Ellipse | O | outline or filled, anti-aliased |
| Fill | F | the fill bucket: fills the connected area of exactly that colour |
| Text | T | click, type; Enter for a new line, Esc or a click elsewhere ends it |
| Colour picker | I | takes the colour under the pointer; then back to the previous tool |
| Select | S | drag a rectangle; drag inside it to move it |
Below the tools: outline or filled for rectangle and ellipse.
How do I choose colours and the size?
At the bottom: the big square is the primary colour (what you draw with), the one behind it the secondary colour (eraser, delete, the hole left by a moved selection). Click a palette colour for primary, right-click for secondary; ⇄ or X swaps them. The palette button (or a click on the primary square) opens Custom colour: a saturation/brightness square and a hue bar. The slider sets the size (1–64 px); [ and ] step it. For text the size becomes the letter size.
How do I select, copy, paste and crop?
Choose Select, drag a rectangle. Then:
- drag inside it to move it (the old place becomes the secondary colour); arrow keys nudge it one pixel;
- Ctrl+C copies (also onto the system clipboard as PNG, so you can paste it in Chromium or mail), Ctrl+X cuts, Delete clears it;
- Ctrl+V pastes an image from the clipboard (from Draw, the browser or a Wayland app; PNG, JPEG, GIF or WebP) as a movable selection at the top left of what you see;
- the crop button keeps only the selection;
- Ctrl+A selects everything. Without a selection, Copy copies the whole picture.
How do I undo?
Ctrl+Z undoes, Ctrl+Y redoes (also the arrow buttons in the bar). Up to 32 steps are kept, at most 256 MiB together: the oldest go first.
How do I zoom and scroll?
The magnifiers in the bar (or Ctrl+plus/minus, +/−), the percentage goes back to 100 %, the frame button fits the picture into the window. Ctrl+wheel zooms around the pointer. The wheel and two fingers on the touchpad scroll; the scrollbars can be dragged; arrow keys scroll too.
How do I open and save?
Open (Ctrl+O) opens the file picker (My files, USB sticks, …; double-click a picture). Save (Ctrl+S) opens Save as with the name of the picture; PNG or JPEG next to it chooses the format. New (Ctrl+N) asks for a size (default 1280 × 720). If there are unsaved changes, Draw asks first: Save, Don't save or Cancel; the same when you close the window.
Can I draw with my finger or a pen?
Yes: a finger on the touchscreen and a pen draw like the mouse. The pen's pressure is not used yet (the pointer layer does not report it), so a pen draws with the chosen size.
What can I open?
PNG, JPEG (EXIF rotation is applied), GIF (first frame) and WebP, up to 20 MB, at most 8000 × 8000 pixels and 16 megapixels. Transparency becomes white. Larger pictures are refused before they are decoded.
Details
- The picture is opaque
0x00RRGGBBin memory. A stroke keeps a coverage mask per pixel, so overlapping segments never darken an anti-aliased edge; all rasterising is integer fixed point (1/256 pixel), because the kernel computes floating point in software. - Flood fill is a scanline fill with its own stack (no recursion), exact colour match, 4-connected.
- An operation (stroke, shape, text, moved selection) keeps a copy of the picture from before it; when it ends, only the changed rectangle becomes an undo step. Crop, resize, rotate and flip store the whole picture.
- While you draw, only the changed part of the window is drawn again.
- PNG is written by our own encoder (
euzos_image::write, deflate with fixed codes), JPEG byeuzos_image::jpeg_write(quality 90).
Reference
Functions and modules
| Module | What |
|---|---|
libs/ui/src/apps/draw/mod.rs | the app: tools, operations, selection, dialogs, keys |
libs/ui/src/apps/draw/view.rs | layout, drawing, hit testing, zoom and scrolling |
libs/ui/src/apps/draw/raster.rs | strokes, line, rectangle, ellipse, flood fill |
libs/ui/src/apps/draw/history.rs | undo/redo (32 steps, 256 MiB) |
libs/ui/src/apps/draw/picture.rs | the picture, transforms, open/save, limits |
kernel/src/draw_app.rs | keys, the file picker, Save as, the clipboard |
kernel/src/screen.rs (draw_pointer, draw_wheel, draw_redraw) | pointer, wheel and partial redraw |
Keyboard
Ctrl+Z / Ctrl+Y undo/redo · Ctrl+C / Ctrl+X / Ctrl+V · Delete · Ctrl+A · Ctrl+S save · Ctrl+O open · Ctrl+N new · Ctrl+plus/minus/0 zoom · Esc ends text or selection · P B E L R O F T I S tools · X swap colours · [ ] size.
Preview
euzos-ui-preview tekenen <dir> [languages] (tools/ui) renders the window with a sample drawing, paste, zoom and the dialogs; --licht for the light theme.
See also
- docs/DESKTOP-DESIGN.md, section "Draw"
- FAQ: Explorer, Desktop and apps, Input
EUZOS