How to implement the dashed skew line

Hi Gabor,
I want to implement the dashed line in line_draw_skew() function, but I have no idea.Can you give me some advices?


Unfortunately, it’s not supported now. I suggest using an image in “Alpha 2 bit” format. Could it work for you?

PS: It’s a community forum and you can ask from the whole community not only from me. So please say “Hi”, instead of “Hi Gabor”. :slight_smile:

Alternatively there are two other ways you could do it:

  • If you can afford the memory, create many individual line objects and put them inside a parent object. Then you can move the parent object and the dashed lines will go with it.
  • Use the lv_canvas object and draw dashed lines on it. Con: no antialiasing IIRC.

lv_canvas_draw_line uses the “core” line draw algorithm in v6.0 so it’s anti-aliased and has perpendicular endings.

Good to know! Thanks!

Thanks for your answer, I have a try to implement dashed lines based on canvas. It just jumps dashed part of line, only display the point line,but it does not look very well.

Can you show the code (and/or a screenshot)?

It seems the issue is in your algorithm. Let’s start with a more simple example. Just draw one skew dashed line. How does it look like, and how do you draw it?

Hello, have you implemented this feature? I would like to consult with you