hi all,
some code:
task<String^> InternalProcess(IStorageFile^ input)
{
StorageFolder^ localFolder = ApplicationData::Current->LocalFolder;
task<StorageFile^>(input->CopyAsync(localFolder, "tmpfile", NameCollisionOption::ReplaceExisting));
auto op = input->CopyAsync(localFolder, "tmpfile", NameCollisionOption::ReplaceExisting);
task<StorageFile^> copyTask(op);
return copyTask.then([](StorageFile^ file){
//process image
String^ result;
return result;
});
}
IAsyncOperation<String^>^ winrt::ProcessImage(IStorageFile^ input)
{
m_inputFile = input;
return create_async([this]() -> task<String^>{
return InternalProcess(m_inputFile);
});
}
why does the ui still get blocked when calling this ProcessImage method from Javascript?