8
私はスクリーンショットを取り、いくつかのサーバーに送信する必要がWP8のWindows Phone取っていないスクリーンショットを完全
でタスクを持ってきたときにユーザーをタップ(ボタンまたはそう?)WP8画面
Iで正常に送信していますが、問題は、時にはそれがここで
が私のコードで私のサーバーに画面全体を送信していないされています
private void LayoutRoot_MouseLeave(object sender, MouseEventArgs e)
{
TakeScreenShort();
} private void TakeScreenShort()
{
WriteableBitmap bmpCurrentScreenImage = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
bmpCurrentScreenImage.Render(LayoutRoot, new MatrixTransform());
bmpCurrentScreenImage.Invalidate();
byte[] bytearray = null;
using (MemoryStream ms = new MemoryStream())
{
WriteableBitmap wbitmp = new WriteableBitmap(bmpCurrentScreenImage);
wbitmp.SaveJpeg(ms, wbitmp.PixelWidth, wbitmp.PixelHeight, 0, 100);
ms.Seek(100, SeekOrigin.Current);
bytearray = ms.GetBuffer();
}
string str = Convert.ToBase64String(bytearray);
string json = JsonConvert.SerializeObject(new
{
id = 11544714,
img = str,
width = bmpCurrentScreenImage.PixelWidth,
height = bmpCurrentScreenImage.PixelHeight,
});
string url = "http://178.188.9.96/imageservice/image.php";
WebClient webClient = new WebClient();
webClient.Headers["Content-Type"] = "application/json";
webClient.Encoding = Encoding.UTF8;
webClient.UploadStringCompleted += new UploadStringCompletedEventHandler(proxy_UploadStringCompleted);
webClient.UploadStringAsync(new Uri(url), "POST", json, null);
}
private void proxy_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
{
var response = e.Result;
var jsonData = JsonConvert.DeserializeObject<RootObject>(response);
}
時にはそれは、フルスクリーンとsometiを取っていますそれは画面全体を撮影していません。
これについてはわかりませんが、telerikにはエラー報告のために既に実装されているこのフォームがあると思います。どういうわけか、エラーレポートにベース64の文字列を電子メールで送信してから、Webサイトを使用してスクリーンショットを表示することができます。多分あなたのためにヘルパーメソッドがありますか? – Quincy