How to create simply arrow - second edition

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
rozowykubek
Posts: 4
Joined: 2012-11-12T11:01:28-07:00
Authentication code: 67790

How to create simply arrow - second edition

Post by rozowykubek »

Hey

preface&task number 1
To be honest my lecturer gave me weird task in exchange for possibility to leave his classes without any consequences (i am college student and in december i want to go abroad for a month ) it has to be ImageMagick whose i did not know until yesterday

Task 1 - completed
Last edited by rozowykubek on 2012-11-16T15:46:46-07:00, edited 5 times in total.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: How to create simply arrow by using common command promp

Post by Bonzo »

You can draw multiple lines one after the other and you know where the end of the horizontal line is.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: How to create simply arrow by using common command promp

Post by glennrp »

Why not simply draw 3 lines?
rozowykubek
Posts: 4
Joined: 2012-11-12T11:01:28-07:00
Authentication code: 67790

Re: How to create simply arrow by using common command promp

Post by rozowykubek »

i was so absorbed with understanding commands et cetera that i did not think about such brilliant solution :lol:
rozowykubek
Posts: 4
Joined: 2012-11-12T11:01:28-07:00
Authentication code: 67790

Re: How to create simply arrow - second edition

Post by rozowykubek »

With your briliant and trival at the same time solution :lol: i was able to survive face to face encounter with my lecturer, but he gone further and gave me another, more complicated arrow quest. If I understood him correctly i have to make "arrow head" pattern which I could generate on the end of earlier created line. I Assume it has to look similar to example down below

Question is, is it possible to do it without using of external application like Bash for example ? and if, with which command should I get closer ?
He ( lecturer ) was talking something about "stroke" and making arrowhead by using just command prompt -.-
Thank you for any tips :)

arrow_head="l -15,-5 +5,+5 -5,+5 +15,-5 z"

convert -size 100x60 xc: -draw 'line 10,30 80,30' \
-draw "stroke blue fill skyblue
path 'M 80,30 $arrow_head' " \
arrow_horizontal.gif
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to create simply arrow - second edition

Post by fmw42 »

rozowykubek
Posts: 4
Joined: 2012-11-12T11:01:28-07:00
Authentication code: 67790

Re: How to create simply arrow - second edition

Post by rozowykubek »

ok, finally I made it in bash and it looks like this:
#!/bin/bash
echo 'rysujemy glowe strzalki'
arrow_head="path 'M 0,0 l -15,-5 +5,+5 -5,+5 +15,-5 z'"
convert test.jpeg -draw 'line 40,100 200,180' \
-draw "stroke blue fill skyblue
translate 200,180 rotate -45 $arrow_head' " \
test_arrow.jpeg
echo 'narysowana'

Is that possible to do the same but in semi-automatic way without using every time "rotate" command ?
I would like "arrow head" following after the main line but I do not see something like this in examples :?
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: How to create simply arrow - second edition

Post by whugemann »

Strange arrow head that you are drawing here ... I'm not sure what you mean by the arrow head following the main line, but what I would rather do is to define the entire arrow as one polygon object and then place it in its entirety by using translate (and possibly rotate) before drawing that object.
Wolfgang Hugemann
Post Reply