2017-10-17 8 views
0

私はコードを学習し、google streetview screenshostをキャプチャするアプリをやっています。多くのスクリーンショット。私は、クエリを並列化する方法を見つけたいと思っています。c#uwp:ディスパッチwebviewナビゲーションと各avaible論理CPUのキャプチャ

ここで一度に単一のクエリのためのコード:

// prepare the html code string in a dictionary (I use street view in a iframe) 
Dictionary<int, string> htmlCode= SetUpURLListHD(); 

// prepare the webview and display it on a grid 
WebView saveWebView = new WebView(); 
saveWebView.Width = Width; 
saveWebView.Height = Height; 
TopGrid.Children.Add(saveWebView); 

// navigate to string, wait a moment until street view completely loaded, do a capture, save it to file m.jpg with custom function 
for (var m = 0; m < htmlCode.Count; m++) 
      { 
       saveWebView.NavigateToString(htmlCode[m]); 
       await Task.Delay(2000); 
       await saveWebView.CapturePreviewToStreamAsync(stream); 
       await SaveSSAsync(stream, m); 
      } 

私は16論理CPU、RAMの64Go、およびファイバ接続を持っています。だから、私は時間に16のクエリまでやりたいそのために

、私は私が16 webviews作成するために、16個の機能を記述する必要があると思う:

async Task ProcessURLHD1Async(string url, int i, int width, int height, ulong firstFrameSize) 
     { 
      try 
      { 
       WebView saveWebView1 = new WebView(); 
       saveWebView1.Width = width; 
       saveWebView1.Height = height; 
       TopGrid.Children.Add(saveWebView1); 
       ... 

セカンド機能:

async Task ProcessURLHD2Async(string url, int i, int width, int height, ulong firstFrameSize) 
     { 
      try 
      { 
       WebView saveWebView2 = new WebView(); 
       saveWebView2.Width = width; 
       saveWebView2.Height = height; 
       TopGrid.Children.Add(saveWebView2); 

など...

私は知りませんもしそれが正しい方法であれば。 私は今16の関数を同時に実行しようとしています。終了すると、次のhtmlコード(辞書にコード化された次のストリートビューの画像)で再び開始します。 今のところ、結果はありません。 何か助けを歓迎します。

ありがとうございました!

ps:このサイトで助けてくれてありがとう、何週間ものコーディングの後、私の最初のメッセージです。

編集:OK!私は見つけた!それは醜いですが、速いです! :

// below namespace : 

    public static class DispatcherTaskExtensions 
    { 
     public static async Task<T> RunTaskAsync<T>(this CoreDispatcher dispatcher, 
      Func<Task<T>> func, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) 
     { 
      var taskCompletionSource = new TaskCompletionSource<T>(); 
      await dispatcher.RunAsync(priority, async() => 
      { 
       try 
       { 
        taskCompletionSource.SetResult(await func()); 
       } 
       catch (Exception ex) 
       { 
        taskCompletionSource.SetException(ex); 
       } 
      }); 
      return await taskCompletionSource.Task; 
     } 

     // There is no TaskCompletionSource<void> so we use a bool that we throw away. 
     public static async Task RunTaskAsync(this CoreDispatcher dispatcher, 
      Func<Task> func, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) => 
      await RunTaskAsync(dispatcher, async() => { await func(); return false; }, priority); 
    } 

//Call function on click 
private async void GetHDMT_Click(object sender, RoutedEventArgs e) 
     { 
      if (outputFolder == null) 
      { 
       var folderPicker = new Windows.Storage.Pickers.FolderPicker(); 
       folderPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop; 
       folderPicker.FileTypeFilter.Add("*"); 

       outputFolder = await folderPicker.PickSingleFolderAsync(); 
       if (outputFolder != null) 
       { 
        // Application now has read/write access to all contents in the picked folder 
        // (including other sub-folder contents) 
        Windows.Storage.AccessCache.StorageApplicationPermissions. 
        FutureAccessList.AddOrReplace("PickedFolderToken", outputFolder); 
       } 
       else 
       { 
       } 
      } 
      if (mylat.Count > 0) 
      { 

       await GetImagesAsyncHD(); 
      } 
     } 


private async Task GetImagesAsyncHD() 
     { 
// Make a list of html code with street view iframe. 
      var Width = 4000; 
      var Height = 2000; 
      var urls = SetUpURLListHD(Width, Height); 


      WebView saveWebView0 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView0); 
      WebView saveWebView1 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView1); 
      WebView saveWebView2 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView2); 
      WebView saveWebView3 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView3); WebView 
       saveWebView4 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView4); 
      WebView saveWebView5 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView5); 
      WebView saveWebView6 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView6); 
      WebView saveWebView7 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView7); WebView 
       saveWebView8 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView8); 
      WebView saveWebView9 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView9); 
      WebView saveWebView10 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView10); 
      WebView saveWebView11 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView11); 
      WebView saveWebView12 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView12); 
      WebView saveWebView13 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView13); 
      WebView saveWebView14 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView14); 
      WebView saveWebView15 = new WebView 
      { 
       Width = Width, 
       Height = Height 
      }; 
      TopGrid.Children.Add(saveWebView15); 
      List<Task> tasks = new List<Task>(); 
      Task t0 = Task.Run(async() => 
      { 
       for (var j=0; j<urls.Count; j=j+16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t0); 
      Task t1 = Task.Run(async() => 
      { 
       for (var j = 1; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t1); 
      Task t2 = Task.Run(async() => 
      { 
       for (var j = 2; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t2); 
      Task t3 = Task.Run(async() => 
      { 
       for (var j = 3; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t3); 
      Task t4 = Task.Run(async() => 
      { 
       for (var j = 4; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t4); 
      Task t5 = Task.Run(async() => 
      { 
       for (var j = 5; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t5); 
      Task t6 = Task.Run(async() => 
      { 
       for (var j = 6; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t6); 
      Task t7 = Task.Run(async() => 
      { 
       for (var j = 7; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t7); 
      Task t8 = Task.Run(async() => 
      { 
       for (var j = 8; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t8); 
      Task t9 = Task.Run(async() => 
      { 
       for (var j = 9; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t9); 
      Task t10 = Task.Run(async() => 
      { 
       for (var j = 10; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t10); 
      Task t11 = Task.Run(async() => 
      { 
       for (var j = 11; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t11); 
      Task t12 = Task.Run(async() => 
      { 
       for (var j = 12; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t12); 
      Task t13 = Task.Run(async() => 
      { 
       for (var j = 13; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t13); 
      Task t14 = Task.Run(async() => 
      { 
       for (var j = 14; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t14); 
      Task t15 = Task.Run(async() => 
      { 
       for (var j = 15; j < urls.Count; j = j + 16) 
        await ProcessURLHD0Async(urls[j], j, Width, Height, firstFrameSize, saveWebView0, outputFolder); 
      }); 
      tasks.Add(t15); 

      await Task.WhenAll(tasks); 
     } 

public static async Task ProcessURLHD0Async(string url, int i, int width, int height, ulong firstFrameSize, WebView saveWeb, StorageFolder folder) 
     { 
      try 
      { 
       var dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher; 
       await dispatcher.RunAsync(CoreDispatcherPriority.Normal,() => 
       { 
        saveWeb.NavigateToString(url); 
       }); 


       await Task.Delay(3000); 
       var kk = 0; 
       var pixelised = true; 

       while (pixelised == true) 
       { 
        ulong thissize = await CaptureAndSave(saveWeb, i, folder); 
        if ((thissize > 0.7 * firstFrameSize) || kk > 5) 
        { 
         pixelised = false; 
        } 
        else 
        { 
         await Task.Delay(1000); 
         kk = kk + 1; 
        } 
       } 

      } 
      catch (Exception) 
      { 
       throw; 
      } 
     } 

public static async Task<ulong> CaptureAndSave(WebView webv, int i, StorageFolder folder) 
     { 
      ulong size = 0; 
      SoftwareBitmap softwareBitmap = null; 
      InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream(); 
      BitmapDecoder decoder = null; 
      // Changes to imageElement must happen on the UI thread. 
      await webv.Dispatcher.RunTaskAsync(async() => 
      {    
       await webv.CapturePreviewToStreamAsync(stream); 
       decoder = await BitmapDecoder.CreateAsync(stream); 
       softwareBitmap = await decoder.GetSoftwareBitmapAsync(); 
      }); 

       StorageFile file_Save = await folder.CreateFileAsync(i + ".jpg", CreationCollisionOption.ReplaceExisting); 
       if (file_Save != null) 
       { 
        using (var streamF = await file_Save.OpenAsync(FileAccessMode.ReadWrite)) 
        { 
         //StorageFile file_Save = await outputFolder.CreateFileAsync(i + "_" + equals + "_" + size + ".jpg", CreationCollisionOption.ReplaceExisting); 
         //< encoder to save > 
         BitmapEncoder encoder = await BitmapEncoder.CreateAsync(Windows.Graphics.Imaging.BitmapEncoder.JpegEncoderId, streamF); 
         encoder.SetSoftwareBitmap(softwareBitmap); 
         await encoder.FlushAsync(); 
         //</ encoder to save > 
         //-</ Save Bitmap as File >- 
        } 
       } 
       var basicProperties = await file_Save.GetBasicPropertiesAsync(); 
       size = basicProperties.Size; 
       while (size < 21) 
       { 
        await Task.Delay(100); 
        basicProperties = await file_Save.GetBasicPropertiesAsync(); 
        size = basicProperties.Size; 
       } 
       stream.Dispose(); 
       softwareBitmap.Dispose(); 


      return size; 
     } 

結果:パラレル化なしで278に対して20秒で118キャプチャ(合計= 139Mo)!最大5GBのRAMを使用します。

編集2: 絶食する...上記のコードに誤りがあった私は(Savewebview1、Savewebview2 ....)を補正するとき、私はいつも、Savewebview0を使用し、結果されています... 400秒... すべての作業はメインスレッドで行いますが、私は他のスレッドでWebviewを作成する必要がありますが、それは不可能だと思います... 誰でもアイデアがあれば... :(

答えて

0

Ok、 、私は良い結果を持って

コードはそれを使用したい人のためにここにある:。

public static class DispatcherTaskExtensions 
    { 
     public static async Task<T> RunTaskAsync<T>(this CoreDispatcher dispatcher, 
      Func<Task<T>> func, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) 
     { 
      var taskCompletionSource = new TaskCompletionSource<T>(); 
      await dispatcher.RunAsync(priority, async() => 
      { 
       try 
       { 
        taskCompletionSource.SetResult(await func()); 
       } 
       catch (Exception ex) 
       { 
        taskCompletionSource.SetException(ex); 
       } 
      }); 
      return await taskCompletionSource.Task; 
     } 

     // There is no TaskCompletionSource<void> so we use a bool that we throw away. 
     public static async Task RunTaskAsync(this CoreDispatcher dispatcher, 
      Func<Task> func, CoreDispatcherPriority priority = CoreDispatcherPriority.Normal) => 
      await RunTaskAsync(dispatcher, async() => { await func(); return false; }, priority); 
    } 

上記のコードはネームスペースのdelcarationの下にあります。

private async void GetHDMT2_Click(object sender, RoutedEventArgs e) 
    { 
     if (outputFolder == null) 
     { 
      var folderPicker = new Windows.Storage.Pickers.FolderPicker(); 
      folderPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop; 
      folderPicker.FileTypeFilter.Add("*"); 

      outputFolder = await folderPicker.PickSingleFolderAsync(); 
      if (outputFolder != null) 
      { 
       Windows.Storage.AccessCache.StorageApplicationPermissions. 
       FutureAccessList.AddOrReplace("PickedFolderToken", outputFolder); 
      } 
      else 
      { 
      } 
     } 
     if (mylat.Count > 0) 
     { 
      await GetImagesAsyncHD2(); 
     } 
    } 

    private async Task GetImagesAsyncHD2() 
    { 
     // Make a dictionary with html code string (with street view iframe inside . 
     var Width = 4000; 
     var Height = 2000; 
     Dictionary<int,string> urls = SetUpURLListHD(Width, Height); 

     //Code to estimate time for completely loading the first page (compute a time to use in await task.delay, and the size of first frame nextly used to know if image is pixelised or not (street view fisnish loading or not) 
     SoftwareBitmap softwareBitmap = null; 
     InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream(); 
     BitmapDecoder decoder = null; 
     var k = 0; 
     WebView saveWebView = new WebView(); 
     saveWebView.Width = Width; 
     saveWebView.Height = Height; 
     TopGrid.Children.Add(saveWebView); 
     var stopwatch = new Stopwatch(); 
     stopwatch.Start(); 
     long elapsed_time=0; 
     saveWebView.NavigateToString(urls[0]); 
     await Task.Delay(10); 
     bool equals = false; 
     bool findeq = false; 
     int t = 0; 
     int countTrue = 0; 
     bool checka = false; 
     List<byte[]> bytes400a = null; 
     List<byte[]> bytes400b = null; 
     await saveWebView.CapturePreviewToStreamAsync(stream); 
     decoder = await BitmapDecoder.CreateAsync(stream); 
     softwareBitmap = await decoder.GetSoftwareBitmapAsync(); 
     bytes400a = GetPixelsP(softwareBitmap); 
     while (countTrue < 20) 
     { 
      await Task.Delay(50); 
      if (checka) 
      { 
       await saveWebView.CapturePreviewToStreamAsync(stream); 
       decoder = await BitmapDecoder.CreateAsync(stream); 
       softwareBitmap = await decoder.GetSoftwareBitmapAsync(); 
       bytes400a = GetPixelsP(softwareBitmap); 
       checka = false; 
      } 
      else 
      { 
       await saveWebView.CapturePreviewToStreamAsync(stream); 
       decoder = await BitmapDecoder.CreateAsync(stream); 
       softwareBitmap = await decoder.GetSoftwareBitmapAsync(); 
       bytes400b = GetPixelsP(softwareBitmap); 
       checka = true; 
      } 
      t = t + 1; 
      equals = EqualsByte(bytes400a, bytes400b); 
      if (equals) 
      { 
       countTrue = countTrue + 1; 
      } 
      if ((equals) && (findeq == false)) 
      { 
       k = t; 
       elapsed_time = stopwatch.ElapsedMilliseconds; 
       SlidetimeCompute.Value = elapsed_time; 
       findeq = true; 
      } 
      if (equals == false) { findeq = false; } 
     } 
     stopwatch.Stop(); 
     var elapsed_timeForTest = stopwatch.ElapsedMilliseconds; 
     await SaveSSAsync(softwareBitmap, "0"); 
     ulong firstFrameSize = await GetSizePicAsync("0"); 
     TopGrid.Children.Remove(saveWebView); 
     stream.Dispose(); 
     softwareBitmap.Dispose(); 

     double timeTowait = (double)elapsed_time; 
     timeTowait = Math.Round(timeTowait/4); 

     // prepare somes grids 
     var nj = 7; 
     List<Grid> grids = new List<Grid>(); 
     Grid tmpgrid0 = new Grid(); 
     grids.Add(tmpgrid0); 
     Grid tmpgrid1 = new Grid(); 
     grids.Add(tmpgrid1); 
     Grid tmpgrid2 = new Grid(); 
     grids.Add(tmpgrid2); 
     Grid tmpgrid3 = new Grid(); 
     grids.Add(tmpgrid3); 
     Grid tmpgrid4 = new Grid(); 
     grids.Add(tmpgrid4); 
     Grid tmpgrid5 = new Grid(); 
     grids.Add(tmpgrid5); 
     Grid tmpgrid6 = new Grid(); 
     grids.Add(tmpgrid6); 
     Grid tmpgrid7 = new Grid(); 
     grids.Add(tmpgrid7); 
     Grid tmpgrid8 = new Grid(); 
     grids.Add(tmpgrid8); 
     Grid tmpgrid9 = new Grid(); 
     grids.Add(tmpgrid9); 
     Grid tmpgrid10 = new Grid(); 
     grids.Add(tmpgrid10); 
     Grid tmpgrid11 = new Grid(); 
     grids.Add(tmpgrid11); 
     Grid tmpgrid12 = new Grid(); 
     grids.Add(tmpgrid12); 
     Grid tmpgrid13 = new Grid(); 
     grids.Add(tmpgrid13); 
     Grid tmpgrid14 = new Grid(); 
     grids.Add(tmpgrid14); 
     Grid tmpgrid15 = new Grid(); 
     grids.Add(tmpgrid15); 
     Grid tmpgrid16 = new Grid(); 
     grids.Add(tmpgrid16); 

     // add tasks 
     List<Task> tasks = new List<Task>(); 
     for (var i = 1; i < nj+1; i++) 
     { 
      TopGrid.Children.Add(grids[i]); 
      await Task.Delay(1000); 
      tasks.Add(await AddTaskAsync(i, nj, Width, Height, firstFrameSize,outputFolder, grids[i], urls, timeTowait) 
       ); 
     } 
     // await all tasks 
     await Task.WhenAll(tasks); 
    } 

    public static async Task<Task> AddTaskAsync(int i, int nj, int width, int height, ulong firstFrameSize, StorageFolder folder, Grid grid, Dictionary<int, string> urls, double timeTowait) 
    { 
     var t0 = Task.Run(async() => 
     { 
      for (var j = i; j < urls.Count; j = j + nj) 
       await ProcessURLHD1Async(urls[j], j, width, height, firstFrameSize, folder, grid, timeTowait); 
     }); 
     await Task.Delay(200); 
     return t0; 
    } 

    public static async Task ProcessURLHD1Async(string url, int i, int width, int height, ulong firstFrameSize, StorageFolder folder, Grid grid, double timeTowait) 
    { 
     try 
     { 
      var Dispatcher = CoreApplication.MainView.CoreWindow.Dispatcher; 
      await grid.Dispatcher.RunTaskAsync(async() => 
      { 
       var saveWeb1 = new WebView(WebViewExecutionMode.SeparateThread) 
       { 
        Width = width, 
        Height = height 
       }; 
       grid.Children.Add(saveWeb1); 
       saveWeb1.NavigateToString(url); 
       //give street view some delay to load 
       await Task.Delay((int)timeTowait*5); 
       var kk = 0; 
       var pixelised = true; 
       SoftwareBitmap softwareBitmap = null; 
       InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream(); 
       BitmapDecoder decoder = null; 

       while (pixelised == true) 
       { 
        await saveWeb1.CapturePreviewToStreamAsync(stream); 
        decoder = await BitmapDecoder.CreateAsync(stream); 
        softwareBitmap = await decoder.GetSoftwareBitmapAsync(); 


        StorageFile file_Save = await folder.CreateFileAsync(i + ".jpg", CreationCollisionOption.ReplaceExisting); 
        if (file_Save != null) 
        { 
         using (var streamF = await file_Save.OpenAsync(FileAccessMode.ReadWrite)) 
         { 
          BitmapEncoder encoder = await BitmapEncoder.CreateAsync(Windows.Graphics.Imaging.BitmapEncoder.JpegEncoderId, streamF); 
          encoder.SetSoftwareBitmap(softwareBitmap); 
          await encoder.FlushAsync(); 
         } 
        } 
        var basicProperties = await file_Save.GetBasicPropertiesAsync(); 
        ulong thissize = basicProperties.Size; 
        while (thissize < 21) 
        { 
         await Task.Delay(100); 
         basicProperties = await file_Save.GetBasicPropertiesAsync(); 
         thissize = basicProperties.Size; 
        } 

        if ((thissize > 0.7 * firstFrameSize) || kk > 10) 
        { 
         pixelised = false; 
        } 
        else 
        { 
         await Task.Delay((int)timeTowait*2); 
         kk = kk + 1; 
        } 
       } 
       stream.Dispose(); 
       softwareBitmap.Dispose(); 
       grid.Children.Clear(); 

      }); 
     } 
     catch (Exception) 
     { 
      throw; 
     } 
    } 

最高の結果は、7つのタスクを並行して行います。なぜ7?わからない。 シングルタスクでは、304秒で118個のキャプチャ(141Mo)、7つのタスクで58秒! 異なるハードウェアとインターネット接続にコードを適合させる方法を見つける必要があります。

関連する問題