简体   繁体   English

c#中的字节数组或位图到svg

[英]Byte array or bitmap to svg in c#

How can we convert byte array or bitmap to svg in .net and save the svg file. 我们如何在.net中将字节数组或位图转换为svg并保存svg文件。 Is there any library provided by .net or any third party library which can handle this. 是否有.net或任何可以处理此问题的第三方库提供的库。

The problem is that Bimap, JPG, PNG, etc. files are raster graphics: they store a fixed array of pixels in various shades of red, green and blue (or hue, lightness and shade - whatever) while SVG files are vector graphics - which means they store images as "draw line from (x1, y1) to (x2, y2)" and "draw an arc here" commands. 问题是Bimap,JPG,PNG等文件是光栅图形:它们以红色,绿色和蓝色(或色调,亮度和阴影 - 无论如何)的各种色调存储固定的像素阵列,而SVG文件是矢量图形 - 这意味着它们将图像存储为“从(x1,y1)到(x2,y2)的绘制线”和“在这里画弧”命令。 And the two are not compatible. 而且两者不兼容。

It is possible to do - the process is called "vectorisation" - but the results are unlikely to be perfect, and if you are talking about a natural world object (like a photo of a face) it's very, very unlikely to work without some considerable effort on your part. 这是可能的 - 这个过程被称为“矢量化” - 但结果不太可能是完美的,如果你在谈论一个自然世界的对象(比如一张脸的照片),没有一些它是非常非常不可能的。你需要付出相当大的努力。

read the original article at codeproject.com 阅读codeproject.com上的原始文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM