WPF和创建“无尽”的帆布 [英] WPF and creating a "endless" canvas

查看:54
本文介绍了WPF和创建“无尽”的帆布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为小孩制作一个小型绘画程序。我正在考虑制作画布,并允许他们使用它。但是我不想指定尺寸,我想缩小并因此允许一张无尽的纸(使用平移+缩放进行导航)。但是我该怎么做, canvas 似乎只有一个固定的大小,并且调整它的大小似乎不起作用,如何缩放,我的图形却没有

I am trying to make a small drawing program for small children. I am thinking on making a canvas, and allowing them to draw on it. But I do not want to specify a size, I want to zoom out and thus allow a "endless" piece of paper (using pan + zoom to navigate). but how do I do this, the canvas seems to have only a fixed size, and resizing it doesn't seem to work, How about the zoom, my drawings doesn't seem to be vector based, they are very "jagged" when zooming close.

还有其他更好的控件吗?

Any other control that would be better?

推荐答案

看看 InkCanvas 控件,它为您提供了一个像纸板一样可以绘制或手写的区域;除此之外,它还提供了其他各种功能。您可以轻松找到在InkCanvas中实现缩放的示例。一些有用的链接-

Have a look at InkCanvas control, it gives you an area like a board where you may draw or handwrite; apart from this it provides various other features out of the box. You can easily find a sample for implementing zooming in InkCanvas. Some helpful links -

使用InkCanvas绘制:
http://www.kirupa.com/blend_wpf/inkcanvas_pg1.htm

Draw using the InkCanvas: http://www.kirupa.com/blend_wpf/inkcanvas_pg1.htm

有关使用InkCanvas的文章的其他部分-
http://blogs.msdn.com/ b / swick / archive / tags / fun + with + ink + _2600_amp_3b00_ + xaml /

Seres of articles on using InkCanvas- http://blogs.msdn.com/b/swick/archive/tags/fun+with+ink+_2600_amp_3b00_+xaml/

这篇关于WPF和创建“无尽”的帆布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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