有没有一种简单的方法可以在 C# 中显示位图字体(如 .fon)
目前我正在使用 C# 实现一个图形编辑器项目,我的项目应该能够显示位图字体。我计划用 VC++ 编写一个 COM 组件,并将位图字体作为位图数组发送到 C# 并实现一个字符串渲染类。然而,我的项目负责人认为该方法会花费很多时间,并且希望有一个更简单的解决方案。不幸的是,我不知道有任何项目为 .net 框架和 GUI+ 实现位图字体。你们觉得怎么样? 谢谢你!
Currently I am implementing a graphic editor project using C#, my project should to have ability to display bitmap font. I plan to write a COM component in VC++ and send bitmap font as bitmap array to C# and implement a string render class. However my project leader thinks that the method will take to much time and want a easier solution. unfortunately, I don't know any project which implements bitmap font for .net framework and GUI+. What do you guys think?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建基于一系列位图(或单个位图)工作的 MeasureString 和 DrawString 并不是非常困难。这肯定很耗时,但不需要先进的知识或智力。基本上您需要知道的是 Graphics.DrawImage(对于 GDI+)。
.NET Framework 中没有任何内容可以简化此操作,但 XNA 可以。 XNA 可能不合适,但值得一看。请查看 http://creators.xna.com/en-US/。 XNA 使用“精灵”(只不过是位图)的概念和用于将文本显示为一系列精灵的 SpriteFont。
It isn't terribly difficult to create a MeasureString and DrawString that works off of a series of bitmaps (or a single bitmap). It is definately time-consuming, but doesn't require advanced knowledge or intellect. Basically all you need to know is Graphics.DrawImage (for GDI+).
There is nothing in the .NET Framework to simplify this, but XNA does. XNA might not be appropriate, but it's worth having a look at. Check out http://creators.xna.com/en-US/. XNA uses the concept of "sprites" (which is nothing more than bitmaps) and a SpriteFont that is used to display text as a series of sprites.