簡體   English   中英

如何在Windows Phone中的ScheduledTaskAgent上裁剪圖像

[英]How to crop image on ScheduledTaskAgent in Windows Phone

我需要使用ScheduledTaskAgent裁剪圖像。 由於它在后台運行,因此在嘗試實例化WriteableBitmap時會遇到跨線程異常(因為它需要在UI線程中創建)。 我有一個圖像流,如何在不使用WriteableBitmap的情況下裁剪它?

謝謝

您甚至可以在后台代理中使用調度程序(以及UI線程):

protected override void OnInvoke(ScheduledTask task)
{
    Deployment.Current.Dispatcher.BeginInvoke(() =>
    {
        // Use the WriteableBitmap here

        this.NotifyComplete();
    });
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM