有人可以推荐一款用于报告目的的矢量图形引擎吗?

发布于 2024-07-14 02:34:20 字数 79 浏览 9 评论 0原文

需要开发一个 .NET 解决方案,以图形方式表示各个部分的座位,在体育场布局视图中绘制,并作为报告输出...座位将有不同的颜色显示销售状态...

Need to develop a .NET solution to graphically represent seats in sections, plotted in a stadium layout view, and output as a report... the seats would have different colours displaying sales status...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尐偏执 2024-07-21 02:34:20

事实上,乍一看它可能看起来很吓人,但是2D 绘图 在.NET Framework 中实际上很容易使用。

这是一个小示例,它绘制了几个带有抗锯齿边距的彩色填充圆圈:

using System.Drawing;

...

Font font = new Font(FontFamily.GenericMonospace, 8);
Image reportImage = new Bitmap(270, 45);
using (Graphics graphics = Graphics.FromImage(reportImage))
{
    graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

    graphics.FillRectangle(Brushes.White, 
        new Rectangle(new Point(0, 0), reportImage.Size));

    for (int i = 0; i != 6; i++)
    {
        Rectangle r = new Rectangle(20 + i * 40, 15, 25, 15);
        graphics.FillEllipse(
            i % 2 == 0 ? Brushes.DarkOrange : Brushes.DarkKhaki, r);
        graphics.DrawEllipse(Pens.Black, r);

        r.Offset(2, 0);

        graphics.DrawString(i.ToString(), font, Brushes.Black, r);
    }
}
reportImage.Save("C:\\test.bmp");

Indeed, it might look scary at first sight, but 2D drawing in .NET Framework is actually easy to use.

Here is a small example that draws a couple of color filled circles with antialised margin:

using System.Drawing;

...

Font font = new Font(FontFamily.GenericMonospace, 8);
Image reportImage = new Bitmap(270, 45);
using (Graphics graphics = Graphics.FromImage(reportImage))
{
    graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

    graphics.FillRectangle(Brushes.White, 
        new Rectangle(new Point(0, 0), reportImage.Size));

    for (int i = 0; i != 6; i++)
    {
        Rectangle r = new Rectangle(20 + i * 40, 15, 25, 15);
        graphics.FillEllipse(
            i % 2 == 0 ? Brushes.DarkOrange : Brushes.DarkKhaki, r);
        graphics.DrawEllipse(Pens.Black, r);

        r.Offset(2, 0);

        graphics.DrawString(i.ToString(), font, Brushes.Black, r);
    }
}
reportImage.Save("C:\\test.bmp");
眼眸里的那抹悲凉 2024-07-21 02:34:20

看起来很简单,普通的旧 GDI+ 就可以解决问题。

当然,您必须设置一个 GUI,其中可以显示每个体育场的座位计划
通过点击“映射”。

seems simple enough that regular old GDI+ might do the trick.

You would of course have to set up a GUI in which each stadiums seating plan can be
"mapped" by point and click.

淡莣 2024-07-21 02:34:20

Cairo 看起来是一个很棒的工具。 还没有亲自测试过。 但它看起来非常有能力并且支持一堆输出格式

Cairo looks like a great tool. Haven't tested it myself...yet. But it seems very competent and supports a bunch of output formats

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文