在WPF中拖动屏幕右侧的工具栏或工具栏 [英] Drag able Toolbar or toolbar on right side of the screen in WPF

查看:108
本文介绍了在WPF中拖动屏幕右侧的工具栏或工具栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个WPF触控应用程序,其中有一个  "在屏幕上拖动工具栏,用户可以通过该工具栏选择不同类型的工具并在画布上使用它,例如笔工具,颜色,形状等。"也有人可以告诉我
如何制作"透明画布"。 我是WPF的新手,现在我试图找到一个解决方案。有人可以指导我正确的方向。

I am trying to make a WPF touch application in which there is a  "drag able toolbar on the screen through which user can select different type of tools and use it on canvas e.g pen tool, colors, shapes etc." Also can someone tell me how to make a "transparent canvas".  I am new to WPF and I am trying to find a solution for quite a while now. Can someone guide me in the right direction.

推荐答案

嗨Zain,

我想你在stackoverflow上问这个还可以。

I think you asked this on stackoverflow as well.

你可以设置 

You can just set 

<Canvas Background="Transparent"

On SO我描述了在我正在处理的游戏的场景编辑器模块中拖动形状。

On SO I described dragging shapes as I do it in the scenario editor module of the game I'm working on.

我正在使用不同的方法用于在地图编辑器模块中绘制内容。用户绘制墨迹。当他们完成一次击球(在鼠标上也可能是手指离开表面)时,我会采取这种击球并以各种方式处理它。区域有
地形(森林,湖泊,轮廓),它​​们是线(河流,道路)。我捕获绘制形状的几何体,然后在画布中使用。就像单位被添加到"地图"的方式一样。有一些视图模型用于地形类型,它们是
添加到observablecollection和模板到视图中,这些视图显示在画布中,这是一个由itemcontrol提供的项目。

I'm using a different approach for drawing stuff in the map editor module. The user draws on an inkcanvas. When they finish a stroke ( on mouseup which would also be finger off the surface ) I take that stroke and process it in various ways. There are area pieces of terrain ( forest, lake, contour ) and theyre are line ( river, road ). I capture the geometry of the drawn shape and that is then used in a canvas. Like the way units are added to the "map" there are viewmodels for terrain types which are added to an observablecollection and template into views which are presented in the canvas which is itemspresented of an itemcontrol.

https:// imgur。 com / KRQBOja

https://imgur.com/KRQBOja


这篇关于在WPF中拖动屏幕右侧的工具栏或工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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