Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Place a Star on the center of the Canvas
#7
Ok, I saw an example here https://stackoverflow.com/questions/4905...imple-line

And I was be able to place the Star on the middle of the Canvas. This is what I achieve:

[Image: NPWkF9Ul.jpg]



Code:
(define (script-fu-create-a-Star)
   (let* (
       
        (imgWidht 700)
        (ImgHeight 700)
        (points (cons-array 4 'double) )    
        
        (img  (car (gimp-image-new imgWidht ImgHeight RGB)))
        (layer (car (gimp-layer-new img imgWidht ImgHeight RGB-IMAGE "Background" 100 LAYER-MODE-NORMAL)))
        
        
        
        
        )
        
        
        ;Create the Background
        (gimp-image-insert-layer img layer 0 0)
        (gimp-context-set-foreground '(0 0 0))
        (gimp-drawable-fill layer FILL-FOREGROUND)
        (gimp-context-set-brush "2. Star")
        (gimp-context-set-brush-size 210)
        (gimp-context-set-brush-aspect-ratio 2)
        (gimp-context-set-brush-angle 54)
        (gimp-context-get-brush)
        (gimp-context-set-foreground '(255 255 255))
        
        
        (aset points 0 350)
        (aset points 1 350)
        (aset points 2 350)
        (aset points 3 350)
        (gimp-paintbrush-default layer 4 points)
                    
        
        (gimp-display-new img)

OK Administrators, you can mark this post as "solved"
Reply


Messages In This Thread
RE: Place a Star on the center of the Canvas - by Pocholo - 05-05-2020, 07:36 PM

Forum Jump: