如何从inkcanvas直接获取位图图像(在wpf中)
我正在做一个 OCR 项目。我必须从 inkcanvas 的输入中获取图像以在下一步中进行处理,即将该图像转换为二维数组。
我对如何从 inkcanvas 获取位图图像进行处理感到困惑。我一直在从许多来源寻找解决方案,但其中很多只是将 inkcanvas 保存到文件流中。
请帮我! 非常感谢
I am doing an OCR project. I must to get an image from input in inkcanvas to process in the next step, i.e. translate this image to an two-dimension array.
I am confused about that how to get a bitmap image from inkcanvas to process. I have been searching for a solution from many sources but a lot of them just save the inkcanvas to file-stream.
please help me!
thanks so much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这个问题比较旧,但我还必须从墨水画布中获取位图。因此,要回答如何直接从墨水画布获取位图的问题,这里有一个解决方案。希望它仍然有帮助。
I know this question is older but I also had to get a bitmap from the ink canvas. So to answer the question on how to get a bitmap directly from the ink canvas, here is a solution. hope it still helps.
检查这篇博文:
http://www.centrolutions .com/Blog/post/2008/12/09/Convert-WPF-InkCanvas-to-Bitmap.aspx
这将为您提供位图的字节数组,因为你正在做 OCR,这应该足够了。
Check this blog post:
http://www.centrolutions.com/Blog/post/2008/12/09/Convert-WPF-InkCanvas-to-Bitmap.aspx
That gets you a byte array for the bitmap, since you're doing OCR that should be enough.