1 | convert -size 572x100 xc:lightblue ruler1.gif |
1 | convert -fill black -draw "line 72,70 72,100" ruler1.gif ruler2.gif |
1 2 | convert -fill black -draw "$(for n in $(seq 0 72 572) ;\ do echo line $n,70 $n,100 ; done)" ruler1.gif ruler3.gif |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/bin/bash # Take user parameters or set defaults rulername="$1" rulerlength="$2" rulername="${rulername:=ruler.gif}" rulerlength="${rulerlength:=572}" drawstring="" #Build the line definitions for the ruler marks for x1 in `seq 0 72 $rulerlength`; do drawstring="$drawstring line $x1,70 $x1,100" for x2 in 0 36; do (( offset = $x1 + $x2 )) drawstring="$drawstring line $offset,80 $offset,100" for x3 in `seq 6 6 30`; do (( offset2 = $offset + $x3 )) drawstring="$drawstring line $offset2,90 $offset2,100" done done done #Create the ruler convert -size "${rulerlength}x100" xc:lightblue -fill black \ -draw "$drawstring" "$rulername" |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |