我有一个 .jpg 格式的纹理图像,我想将此图像用作 Windows.Media.pen
我使用 Windows.Media.pen 在从 microsoft kinect 获得的 DrawingContext 中绘制骨架数据。
如何将纹理图像 .jpg 用作 Windows.Media.pen?
解决了这个问题。
ImageSource image = new BitmapImage(new Uri(@"...\texture.jpg", UriKind.Relative));
var brush = new ImageBrush(image);
var pen = new Pen(brush, 10);
drawingContext.DrawLine(pen, XPos, YPos);