适用于 XAML 的 Windows Metro 中的 DrawingBrush 在哪里 [英] Where Is DrawingBrush In Windows Metro for XAML

查看:29
本文介绍了适用于 XAML 的 Windows Metro 中的 DrawingBrush 在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 C# 编写一个基于 Windows Metro XAML 的应用程序,我想用我的自定义网格控件上的画笔绘制网格线.

Im writing a Windows Metro XAML based app in C#, and I want to draw grid lines with a brush on my custom grid control.

在 WPF 中,我会创建一个 DrawingBrush 来完成这项工作,但地铁里好像没有等价物???

In WPF I would create a DrawingBrush to do the job, but there seems to be no equivalent in Metro ???

有谁知道此功能是否以其他名称存在,或者您以不同的方式获得相同的结果?

Does anyone know if this feature exists under another name, or that you achieve the same result differently ?

作为附加说明,我不想直接在我的网格上绘制线条等(向我的面板的子集合中添加线条),它确实需要通过背景属性完成 - 即画笔.

As an additional note, I do not want to draw lines etc directly on my grid (adding lines to my panel's children collection), It really needs to be done via the background property - i.e a brush.

谢谢

推荐答案

WinRT-XAML 堆栈更接近 Silverlight - 与 Silverlight 相比,其图形功能也有限.唯一适用于 WinRT 应用程序的 TileBrush 是 ImageBrush,因此您需要先将绘图另存为图像.但是,您也不能使用 XAML 堆栈执行此操作 - 因为没有绘图类并且 WriteableBitmap 没有 Render() 方法.另一方面 - 您可以访问 DirectX 以获得任何更高级的功能,并将一些 DirectX 代码与您的 XAML 结合起来.

WinRT-XAML stack is closer to Silverlight - also in its limited graphics features when compared with Silverlight. The only TileBrush for WinRT apps is the ImageBrush, so you would need to save your drawing as an image first. You can't do that with the XAML stack either though - because there is no drawing class and WriteableBitmap has no Render() method. On the other hand - you can access DirectX for any more advanced features and combine some DirectX code with your XAML.

这篇关于适用于 XAML 的 Windows Metro 中的 DrawingBrush 在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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