← Pyetje të shpeshta

Pyetjet e shpeshta janë shkruar në anglisht dhe holandisht; shfaqen në anglisht.

Pyetje të shpeshta

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):

ToolKeyWhat it does
PencilPa hard line of 1 pixel
BrushBa smooth, anti-aliased round stroke of the chosen size
EraserEa hard square of the chosen size in the secondary colour
LineLa straight anti-aliased line
RectangleRoutline (thickness = size) or filled
EllipseOoutline or filled, anti-aliased
FillFthe fill bucket: fills the connected area of exactly that colour
TextTclick, type; Enter for a new line, Esc or a click elsewhere ends it
Colour pickerItakes the colour under the pointer; then back to the previous tool
SelectSdrag 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 0x00RRGGBB in 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 by euzos_image::jpeg_write (quality 90).

Reference

Functions and modules

ModuleWhat
libs/ui/src/apps/draw/mod.rsthe app: tools, operations, selection, dialogs, keys
libs/ui/src/apps/draw/view.rslayout, drawing, hit testing, zoom and scrolling
libs/ui/src/apps/draw/raster.rsstrokes, line, rectangle, ellipse, flood fill
libs/ui/src/apps/draw/history.rsundo/redo (32 steps, 256 MiB)
libs/ui/src/apps/draw/picture.rsthe picture, transforms, open/save, limits
kernel/src/draw_app.rskeys, 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