2016-09-16 35 views
0

我創建這個圖片IMG:使用此命令難懂的創建具有特定像素寬度

enter image description here

convert -size 720x480 xc:black -strokewidth 5 -stroke lime -draw "line 105,400 205,400" -stroke blue -draw "line 105,405 205,405" -stroke blue -strokewidth 2 -draw "rectangle 140,150 260,230 " -draw "rectangle 320,150 440,230 " -draw "rectangle 500,150 620,230 " -draw "rectangle 140,300 260,380 " -draw "rectangle 320,300 440,380 " -draw "rectangle 500,300 620,380 " test.png 

但我的形象應該是這樣的:

enter image description here

每個矩形應該有一個wi dth爲180px,高度爲120px,綠色/藍色線的寬度爲170px,高度爲10px,我該如何指定?

我試圖ROSTOK的建議,它造就了我這個形象,這是不是100%正確: enter image description here

回答

1

試試這個:

magick convert \ 
-size 720x480 xc:black \ 
-strokewidth 4 \ 
-stroke lime \ 
-draw "line 103,467 273,467" \ 
-stroke #0030ff \ 
-draw "line 103,471 273,471" \ 
-strokewidth 9 \ 
-draw "path 'M 108,159 h 171 v 111 h -171 v -115 Z'" \ 
-draw "path 'M 290,159 h 171 v 111 h -171 v -115 Z'" \ 
-draw "path 'M 472,159 h 171 v 111 h -171 v -115 Z'" \ 
-draw "path 'M 108,288 h 171 v 111 h -171 v -115 Z'" \ 
-draw "path 'M 290,288 h 171 v 111 h -171 v -115 Z'" \ 
-draw "path 'M 472,288 h 171 v 111 h -171 v -115 Z'" \ 
output.png 

你rects有但是橫向和縱向上是不同的筆畫寬度我以爲你到處都想要相同的筆畫。

+0

它不是100%的工作我發佈了你的命令創建的圖像,你可能會看看它。 – utdev

+0

這真的很奇怪。我試過這個代碼:Linux,ImageMagick 6.3.7 11/17/10 Q16,Win ImageMagick 6.7.9-8 2012-09-22 Q8甚至Win ImageMagick 7.0.2-5 Q16 x64,並且都運行良好。你使用什麼版本? – rostok

+0

@rostock我正在使用的版本:ImageMagick 7.0.2-0 Q16 x64 2016-06-12 – utdev

相關問題