在 C# 中从十进制数据创建图像或图形?
是否可以使用小数部分不同的矢量数据创建图像或图形?当然,如果可能的话……那么如何呢?
例如:向量有两个点,其中第一个点是 {9.56, 4.1},第二个点是 {3.456789,2.12345}。
注意:精度因数字而异。
Is it possible to create an image or graphic using vector data that has decimal components that vary? And, of course, if its possible... then how?
For example: a vector has two points where point one is {9.56, 4.1} and point two is {3.456789,2.12345}.
Note: the precision varies from number to number.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将矢量绘制到位图,然后保存该位图,如下所示。
You can draw vectors to a bitmap and then save that bitmap as follows.
哦,当然。例如,Line 类将在 WPF 中绘制一条线。它为每个坐标使用两个双精度值。 X1、Y1 和 X2、Y2。
如果您的数据以十进制数据类型存储,则可以进行简单的转换。
请记住,我试图从你的问题中推断出你想要做什么。您打算如何绘制矢量形状?您的总体方法是什么?
Oh, sure. For example, the Line class will draw a line in WPF. It uses two doubles for each coordinate. X1, Y1 and X2, Y2.
If your data is stored in the decimal datatype, you can do a simple cast.
Keep in mind, I'm trying to extrapolate what you're trying to do from your question. How are you planning to draw your vector shapes? What's your overall approach?