设置Canvas.LineTo的线端样式 [英] Setting the Line End Styles for Canvas.LineTo

查看:258
本文介绍了设置Canvas.LineTo的线端样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为TCanvas.LineTo方法的行尾设置样式?似乎默认为圆角,当Pen.Width设置为较大的值(例如9)时,对于连续几行不同颜色的行来说,这看起来非常糟糕。

>看起来像这样(圆角):

  ******** ........ ****** 
********** ........ ******
********** .. ...... ******
******** ........ ******

(其中*为蓝色,。为黄色)



外线在中线之后绘制:

  ******** .. * ***** 
********** ...... ********
********** ... ... ********
******** ........ ******

我希望它看起来像这样(长度结尾):

  ******** ........ ****** 
******** .. **** **
******** ........ ******
******** .. ** ****

笔似乎没有为此提供任何设置,LineTo方法也没有提供任何设置。

解决方案

也许 ExtCreatePen 帮助。检查 PS_ENDCAP _ * PS_JOIN _ * 标志。


Is there any way to set the style for the lineends for the TCanvas.LineTo method? It seems to default to rounded ends, which looks very bad for several lines in a row of different colours when Pen.Width is set to a large value (e.g. 9).

It looks like this (rounded ends):

 ********........******
**********........******
**********........******
 ********........******

(where * is e.g. blue and . is yellow)

It is even worse if the two outer lines are drawn after the middle line:

 ********........******
**********......********
**********......********
 ********........******

I'd like it to look like this (streight ends):

 ********........******
 ********........******
 ********........******
 ********........******

Pen does not seem to offer any setting for this and neither does the LineTo method. Is there maybe a windows API function I could call?

解决方案

Maybe ExtCreatePen helps. Check the PS_ENDCAP_* and PS_JOIN_* flags.

这篇关于设置Canvas.LineTo的线端样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆