将画布转换为画布 [英] Convert canvas to inkcanvas

查看:120
本文介绍了将画布转换为画布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在wpf和vise-versa中将画布转换为墨水画布吗?并且在处于编辑模式选择"的状态下的画布中,在画布上绘制的路径没有被选中,为什么?

Can i convert canvas to inkcanvas in wpf and vise-versa . and in inkcanvas in editing mode "select", Path drawn on canvas don''t get selected,why?

推荐答案

定义标签后,就定义了它. InkCanvas Canvas不同.在InkCanvas 上绘制的图形为墨水序列化格式(ISF).转换的方法是创建一个Canvas,传递属性,然后在VisualTree中用该Canvas补充InkCanvas .您绘制的路径很可能不是墨水,在ISF中也是如此.无论如何,您都无法与Ink进行交互.如果您希望具有与路径进行交互的功能,则可能必须创建具有自己能力的控件才能与画布上的项目进行交互(当然,您也可以尝试使用事件与画布进行交互).您可以查看 http://wrb.home.xs4all.nl/Articles/Article_WPFInkToXAML_01.htm [ ^ ]进行将墨水转换为图形的工作.我有一个我可以发送给您的项目,但它仅包含路径和某些形状.
Once you define a tag, it is defined. InkCanvas is different from a Canvas. The drawings done on an InkCanvas are in Ink Serialized Format (ISF). The way to convert would be to to create a Canvas, transfer properties, then replece the InkCanvas in the VisualTree with this Canvas. More than likely the path you drew was not ink, so would be in ISF. You cannot interact with Ink anyway. If you want the capability to interact with paths, then you probably will have to create your own control with the abiiity to interact with the items on the canvas (of course you can also try to interact with canvas using events). You can look at http://wrb.home.xs4all.nl/Articles/Article_WPFInkToXAML_01.htm[^] for work done on converting ink to drawing. I do have a project I did I can send you, but it only does paths and some shapes.


这篇关于将画布转换为画布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆