我想從我的基於Web的Silverlight 5應用程序中截取屏幕截圖並將其保存在磁盤上,我的選擇是什麼?我搜索了很多,但沒有發現有用的東西。保存Silverlight 5 web應用程序屏幕截圖到磁盤
0
A
回答
1
This似乎捕捉並保存到磁盤
捕捉
// create a WriteableBitmap
WriteableBitmap bitmap = new WriteableBitmap(
(int)this.LayoutRoot.ActualWidth,
(int)this.LayoutRoot.ActualHeight);
// render the visual element to the WriteableBitmap
bitmap.Render(this.LayoutRoot, this.transform);
// request an redraw of the bitmap
bitmap.Invalidate();
保存
private void ThumbnailClicked(object sender, MouseButtonEventArgs e)
{
// pause the capture timer
this.timer.Stop();
try
{
// locate the WriteableBitmap source for the clicked image
WriteableBitmap bitmap = ((Image)sender).Source as WriteableBitmap;
if (null == bitmap)
{
MessageBox.Show("Nothing to save");
return;
}
// prompt for a location to save it
if (this.dialog.ShowDialog() == true)
{
// the "using" block ensures the stream is cleaned up when we are finished
using (Stream stream = this.dialog.OpenFile())
{
// encode the stream
JPGUtil.EncodeJpg(bitmap, stream);
}
}
}
finally
{
// restart the capture timer
this.timer.Start();
}
}
+0
什麼是this.transform?我沒有,我可以使用單位轉換控制嗎?用戶可以從網上下載保存的圖像嗎? –
+0
我建議閱讀這篇文章,而不僅僅是代碼「你可以通過一個轉換到渲染方法來縮放,旋轉,傾斜和/或翻譯被渲染的元素。」 –
+1
什麼是JpgUtil? –
相關問題
- 1. 以silverlight 5/xna拍攝屏幕截圖
- 2. 保存iPhone應用程序的視頻屏幕截圖
- 3. 應用程序屏幕截圖問題
- 4. 使用Visio繪製Silverlight應用程序的屏幕截圖?
- 5. 將當前屏幕的圖片保存到磁盤AS3
- 6. 回到從Safari保存到主屏幕的web應用程序
- 7. 想要「屏幕截圖」Silverlight應用程序
- 8. QQ屏幕截圖應用程序
- 9. AIR應用程序的屏幕截圖
- 10. AS3舞臺屏幕截圖到硬盤保存
- 11. 如何將文件從Web應用程序保存到用戶的磁盤?
- 12. 保存多個屏幕截圖
- 13. jQuery Mobile web應用程序保存到主屏幕上的Windows手機圖標
- 14. 保存到磁盤能力的客戶端應用程序
- 15. 用WinJS將圖像保存到磁盤
- 16. 保存小部件的屏幕截圖
- 17. 保存watir中的屏幕截圖
- 18. 硒測試保存屏幕截圖
- 19. 如何在Windows應用程序中截取屏幕截圖?
- 20. 從我的應用程序截取設備的屏幕截圖
- 21. iphone - 截取其他應用程序的屏幕截圖?
- 22. 截取應用程序中的屏幕截圖
- 23. 屏幕截圖
- 24. 應用程序到牆壁的屏幕截圖
- 25. 如何採取屏幕截圖和截屏保存在相冊
- 26. 屏幕截圖用戶在網絡應用程序中顯示
- 27. 使用應用程序欄創建屏幕截圖WP8
- 28. 更新應用程序圖標和屏幕截圖
- 29. 將trie保存到磁盤
- 30. Facebook AppCenter for Native應用程序 - 屏幕截圖不會更新
我假設你想以編程方式做到這一點? –
是的,我在我的XAMl中有一些控件,然後當用戶點擊一個按鈕時我想捕捉一個捕捉,那麼用戶應該能夠下載捕捉的圖像 –