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 - Creating a class to run a task in an independent thread

Now, we are going to create a new class capable of reading an image file and generating a high quality thumbnail representation with brightness adjustment. We will use the AForge.NET libraries explained in the previous chapter. This way, later, we will be able to work with a pool of threads using instances of this simple class, and the code will be very easy to understand while we will be avoiding synchronization problems:

  1. Stay in the project, ImageBrowser.
  2. Create a new class, ThumbnailBrightnessAdjuster.
  3. Add the references to the installed libraries so as to access the AForge.NET framework, as we did in the previous chapter.
  4. Add the following lines of code at the beginning ...

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