Re: Drawing a line in a GIMP plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is the code to draw a single pixel line, black on white, on the
drawable "layer" and x1 y1 are one end and x2 y2 are the other.

    (gimp-context-set-brush "Circle (01)")
    (gimp-context-set-foreground "Black")
    (gimp-context-set-background "White")
    (gimp-context-set-opacity 100)
    (gimp-context-set-paint-mode NORMAL-MODE)
    (gimp-pencil layer 4 (vector x1 y1 x2 x2))
    (gimp-displays-flush)

0,0 is upper left hand side.  This is with the pencil tool.  Replace
with any other tool as desired, for example:
    (gimp-paintbrush-default layer 4 (vector x1 y1 x2 y2))

Hope that helps,

-Rob A>
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux