O'Reilly logo

C# 2008 and 2005 Threaded Programming: Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - Queuing requests, running threads, and updating the UI

Now, we are going to make the necessary changes to the main form to show the thumbnails with many brightness adjustments, while the opacity effect runs in another thread:

  1. Stay in the project, ImageBrowser.
  2. Open the code for the Windows Form Form1 (frmMain).
  3. Add the following lines of code at the beginning (as we are going to use the System.Threading.ThreadPool class):
    using System.Threading;
    
  4. Add the following private variables:
    // The thumbnails size private Size poThumbnailSize = new Size(200, 200); // The image file name private string psImageFileName; // The beginning brightness adjustment double piBeginningBrightness = -1; // The ending brightness adjustment double piEndingBrightness ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required