René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback
 

Script-fu example 07: Drawing a circle

Creates a 250x250 picture and draws a circle into it. (See also ex_08)
ex_07.scm
(define (ex_07)

  (let* (
          (my-image (car (gimp-image-new 250 250 RGB      )))

          (my-layer (car (gimp-layer-new my-image 250 250 RGB-IMAGE "my layer" 0 NORMAL)))

          (line_points (cons-array 4 'double)) ; line_points: Array of 4 doubles
        )

        (gimp-image-add-layer my-image my-layer 0)

        (gimp-context-set-background '(010 020 030))
        (gimp-context-set-foreground '(255 245 235))

        (gimp-drawable-fill my-layer BACKGROUND-FILL)

        (gimp-ellipse-select my-image 25 25 200 200 REPLACE 1 0 0)
        (gimp-edit-stroke my-layer)

        (gimp-file-save RUN-NONINTERACTIVE my-image my-layer "c:\\temp\\ex_07.jpg" "")
  )
)

c:\> start gimp-2.2.exe -d -i -b  "(ex_07)" "(gimp-quit 0)"
See also other examples