1
Windows Phone Schedule Agent에서 작업 중이고 동기화 후 그림 이름을 업데이트하려고하는데이 기능을 사용할 때 잘못된 교차 예외가 발생합니다. line "BitmapImage bmp = 새 BitmapImage();" 왜 그런지 이해하지 못합니다.격리 된 저장소에서 작업 할 때 예약 에이전트에서 잘못된 예외가 발생합니다.
void UpdateSyncPictureName(int AsyncStatus, int AticketID, int AsyncID, int ApictureID, int TsyncStatus = 0, int TsyncID = 0)
{
string filename = AsyncStatus + "-" + AticketID + "-" + AsyncID + "-" + ApictureID;
using (IsolatedStorageFile ISF = IsolatedStorageFile.GetUserStoreForApplication())
{
if (ISF.FileExists(filename))
{
BitmapImage bmp = new BitmapImage();
using (IsolatedStorageFileStream isoStream =
ISF.OpenFile(filename, System.IO.FileMode.Open))
{
bmp.SetSource(isoStream);
}
ISF.DeleteFile(filename);
WriteableBitmap Wbmp = new WriteableBitmap(bmp);
using (IsolatedStorageFileStream isoStream =
ISF.OpenFile(TsyncStatus + "-" + AticketID + "-" + TsyncID + "-" + ApictureID, System.IO.FileMode.Create))
{
Extensions.SaveJpeg(Wbmp, isoStream,
Wbmp.PixelWidth,
Wbmp.PixelHeight,
0, 100);
}
}
}
}