[Lazarus] Win32 TPenStyle psDot is ugly

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Win32 TPenStyle psDot is ugly

Free Pascal - Lazarus mailing list
According to MS docs, psDot style must give nice looking 1 pixel dots.
https://docs.microsoft.com/en-us/windows/desktop/gdi/pen-style

Lazarus creates pen via Widgetset's ExtCreatePen which calls Win32
ExtCreatePen.

reality: If I set psDot to StringGrid.GridLineStyle, I get ugly dots:
each of about 3 pixels fragments. psDash is ugly too: dashes are very long.

Why?

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win32 TPenStyle psDot is ugly

Free Pascal - Lazarus mailing list
Line styles are dependent on the ‘Cosmetic’ and ‘EndCap’ settings. For Cosmetic pens with 1-pixel wide lines the dots are elongated. For wider lines it is possible to get round dots by using the ‘pecRound’ cap style.

If you want to get 1 pixel dots followed by 1 pixel spaces then this works for dotted Geometric (Cosmetic = false) pen but only looks OK for horizontal and vertical lines. Guess this is good for grid cell borders.

Regard,
Nigel

> On 29 May 2019, at 22:10, AlexeyT via lazarus <[hidden email]> wrote:
>
> According to MS docs, psDot style must give nice looking 1 pixel dots. https://docs.microsoft.com/en-us/windows/desktop/gdi/pen-style
>
> Lazarus creates pen via Widgetset's ExtCreatePen which calls Win32 ExtCreatePen.
>
> reality: If I set psDot to StringGrid.GridLineStyle, I get ugly dots: each of about 3 pixels fragments. psDash is ugly too: dashes are very long.
>
> Why?
>
> --
> Regards,
> Alexey
>
> --
> _______________________________________________
> lazarus mailing list
> [hidden email]
> https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Win32 TPenStyle psDot is ugly

Free Pascal - Lazarus mailing list
Thanks for this info, made a patch for Grids.

 > 1 pixel dots followed by 1 pixel spaces then this works for dotted
Geometric (Cosmetic = false) pen

--
Regards,
Alexey

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus