Algosim documentation: DrawLine

DrawLine

Draws a line in a pixmap.

Syntax

Description

DrawLine(pm, x0, y0, x1, y1, c) returns pm with a line drawn between (x0, y0) and (x1, y1) with colour c. The line is drawn as a single-pixel solid line with no antialiasing.

Examples

x ≔ 600;
n ≔ 360;
pm ≔ CreatePixmap(x, x);
for(i, 1, n,
  (
    pm ≔ DrawLine(
      pm,
      RandomInt(3⋅x) − x,
      RandomInt(3⋅x) − x,
      RandomInt(3⋅x) − x,
      RandomInt(3⋅x) − x,
      "black")
  )
);
GaussianBlur(ComponentHighlight(pm), 2, 3)

Image 1

MotionBlur(pm, 100)

Image 2

See also