【发布时间】:2011-03-24 08:20:33
【问题描述】:
如何在 WP7 中进行自定义绘图。 WP7 中的 paint 或 onDraw 或 drawRect 方法的等价物是什么? .Net 框架具有 onRender 方法,该方法在 Silverlight for Windows Phone 中不可用。请提出建议。
我在看类似的东西
protected override void OnRender(DrawingContext dc)
{
SolidColorBrush mySolidColorBrush = new SolidColorBrush();
mySolidColorBrush.Color = Colors.LimeGreen;
Pen myPen = new Pen(Brushes.Blue, 10);
Rect myRect = new Rect(0, 0, 500, 500);
dc.DrawRectangle(mySolidColorBrush, myPen, myRect);
}
上述内容在 .NET 框架中可用,但在 Silverlight for Windows Phone 中不可用。我见过 Canvas、Shape、类。问题是我必须做很多绘图,我想如果我直接创建这些类的对象会很重。请指教。
【问题讨论】:
标签: windows-phone-7