我有一个包含更多 10 项的列表框,我编写了一个代码在 Windows Phone 8 上对其进行截图并共享,但它只是将所有内容都显示在屏幕上(3 项)而不是完整的列表框。如何截取完整的 Lisbox?这是我的代码。
var bmp = new WriteableBitmap(lbxDays, new TranslateTransform());
var width = (int)bmp.PixelWidth;
var height = (int)bmp.PixelHeight;
bmp.Render(lbxDays, new TranslateTransform());
using (var ms = new MemoryStream())
{
bmp.SaveJpeg(ms, width, height, 0, 100);
ms.Seek(0, System.IO.SeekOrigin.Begin);
var lib = new MediaLibrary();
var dateStr = DateTime.Now.Ticks;
var picture = lib.SavePicture(string.Format("screenshot"+dateStr+".jpg"), ms);
var task = new ShareMediaTask();
task.FilePath = picture.GetPath();
task.Show();
}