PIL - setting the width of lines in ImageDraw
Erik Heneryd
erik at heneryd.com
Tue Sep 14 05:49:46 EDT 2004
Max M wrote:
> Erik Heneryd wrote:
>
>> Larry Bates wrote:
>>
>>> There's nothing wrong with "slanted" rectangles.
>>> In PIL you just define upper left and lower right
>>> coordinates of the rectangle in pixels. That's
>>> what a thick line would do anyway.
>>
>>
>> Really? Didn't know that. Please show me how.
>
>
>
> The problem is that you have to calculate the rectangles corner
> positions yourself. Which make it a bit less trivial than drawing lines.
>
> If you want a fat line from ((0,0),(10,10)) you would need to calculate
> where the corners should be yourself.
Reason I was (sarcastically) asking about how was because Larry implied
it could be done easily using "drawrectangle", as opposed to calculating
the corners yourself and using polygon.
And ofcourse - just drawing thick lines isn't enough to do thick lined
polygons, you also have to deal with joining them.
Erik
More information about the Python-list
mailing list