PDA

Vollständige Version anzeigen : Mehrere Bilder erstellen und speichern.


Darth Frigus
10.07.2007, 14:38
deleted

schumaml
10.07.2007, 15:22
Du kannst den Code hier auch direkt einfügen, dann wird der öfter gelesen:

(define (script-fu-text-box inFont inFontSize inTextColor)
(let*
(
;local variables
;create a new image
(theImageWidth 10)
(theImageHeight 10)
(theImage (car
(gimp-image-new
theImageWidth
theImageHeight
RGB
)
)
)
(theText) ;declaration for the text
(theBuffer) ;the buffer-space created around the text
(theLayer ;creating a new layer
(car
(gimp-layer-new
theImage
theImageWidth
theImageHeight
RGB-IMAGE
"layer 1"
100
NORMAL
)
)
)
) ;end of local variablesText Box
(gimp-image-add-layer theImage theLayer 0)
(gimp-context-set-background '(255 255 255) )
(gimp-context-set-foreground inTextColor)
(gimp-drawable-fill theLayer BACKGROUND-FILL)

(set! theText
(car
(gimp-text-fontname
theImage theLayer
0 0
"ZURÜCK"
0
TRUE
inFontSize PIXELS
"Sans")
)
)
(set! theImageWidth (car (gimp-drawable-width theText) ) )
(set! theImageHeight (car (gimp-drawable-height theText) ) )
(set! theBuffer (* theImageHeight (/ 30 100) ) )
(set! theImageHeight (+ theImageHeight theBuffer theBuffer) )
(set! theImageWidth (+ theImageWidth theBuffer theBuffer) )
(gimp-image-resize theImage theImageWidth theImageHeight 0 0)
(gimp-layer-resize theLayer theImageWidth theImageHeight 0 0)
(gimp-layer-set-offsets theText theBuffer theBuffer)
(gimp-image-merge-visible-layers theImage EXPAND-AS-NECESSARY)
(gimp-image-convert-indexed
theImage
0
0
250
0
0
"false")
(file-gif-save
1
theImage
theLayer
"/home/kaweh/Desktop/BUTTONS/de/images/buttons/button_back.gif"
"/home/kaweh/Desktop/BUTTONS/de/images/buttons/button_back.gif"
TRUE
0
0
0)
))

(script-fu-register
"script-fu-text-box" ;func name
"BaCa Buttons" ;menu label
"Creates a simple text box, sized to fit around the user's choice of text, font, font size, and color." ;description
"Kaweh Khoshknabi" ;author
"copyright 2007, Kaweh Khoshknabi" ;copyright notice
"July 05, 2007" ;date created
"" ;image type that the script works on
SF-FONT "Font:" "Charter" ;a font variable
SF-ADJUSTMENT "Font size" '(11 1 1000 1 10 0 1)
;a spin-button
SF-COLOR "Color:" '(223 0 41) ;color variable
)
(script-fu-menu-register "script-fu-text-box" "<Toolbox>/Xtns/Script-Fu/Text")

schumaml
10.07.2007, 15:28
Vorschlag: script-fu-text-box so ändern, dass auch der Text als Parameter mitgegeben wird. Dieser sollte dann auch Bestandteil des Dateinamens werden.

Darth Frigus
10.07.2007, 15:39
deleted