admin管理员组文章数量:1334419
The following code gets weird results:
Graphics g(hdc);
Pen pen(Color(0, 0, 0), 50.0f);
std::vector<PointF> line;
line.push_back({ 200, 200 });
line.push_back({ 200, 100 });
line.push_back({ 200, 100 });
line.push_back({ 300, 100 });
g.DrawLines(&pen, line.data(),line.size());
std::vector<PointF> line2;
line2.push_back({ 400, 200 });
line2.push_back({ 400, 100 });
line2.push_back({ 400, 60 });
line2.push_back({ 400, 100 });
line2.push_back({ 500, 100 });
g.DrawLines(&pen, line2.data(), line2.size());
std::vector<PointF> line3;
line3.push_back({ 600, 200 });
line3.push_back({ 600, 100 });
line3.push_back({ 600, 95 });
line3.push_back({ 600, 100 });
line3.push_back({ 700, 100 });
g.DrawLines(&pen, line3.data(), line3.size());
for (std::size_t i = 0; i < line3.size(); ++i) {
line3[i].X += 200;
}
for (std::size_t i = 1; i < line3.size(); ++i)
{
g.DrawLine(&pen, line3[i - 1], line3[i]);
}
Here is the image drawn:
Comments (by images' numbers):
- No issues, works as expected
- Adding one point with displacement more than half of pen size; works as expected
- Moving this point closer so the distance is less than half of pen size. The first issue is here. What is this white area and the diagonal? And where is the part on top as on image (2)?
- Drawing the same image as (3) with series of DrawLine instead of DrawLines. What is this white box at the left top corner and where is the part on top as on image (2)?
Is this a bug or I misinterpret somehow pen's brushes shapes and drawing modes?
(OS: Windows Version 10.0.19044.1889; SDK Version 10.0.26100.0)
本文标签: windowsStrange behaviour of GDI pen and drawlinedrawlinesStack Overflow
版权声明:本文标题:windows - Strange behaviour of GDI+ pen and drawlinedrawlines - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742266939a2443579.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论