Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw non horizontal thick lines #433

Open
remidebette opened this issue Oct 8, 2020 · 4 comments
Open

Draw non horizontal thick lines #433

remidebette opened this issue Oct 8, 2020 · 4 comments

Comments

@remidebette
Copy link

Hi,
Thanks for the nice library.

Following the issue #97, I understand the only way to draw a thick line is by using code similar to this:
draw_filled_rect(&img, Rect::at(128, 10).of_size(118, thickness), Rgb([240, 240, 255]));

But such rectangles are necessarily horizontal from what I understand.
Would it be possible to have a functionality such as this?
https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.line
(two points and a thickness)

Otherwise what could be a workaround?

Thank you

@theotherphil
Copy link
Contributor

https://docs.rs/imageproc/0.21.0/imageproc/drawing/fn.draw_convex_polygon.html Lets you draw filled polygons. However, this makes no attempt to anti-alias the boundary of the polygon.

(If you plan on using this function, note that the next release of this library is likely to include #428 which renames the function to draw_polygon and makes it more general.)

@remidebette
Copy link
Author

Hi, thank you for your response.
I would rather wait for the next version of the lib then.

Do you know when it is scheduled?

@theotherphil
Copy link
Contributor

theotherphil commented Oct 24, 2020

There's no fixed schedule for releases. I'll release a new version this weekend to pick up this change.

@theotherphil
Copy link
Contributor

So much for "this weekend". I've published a new version just now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants