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 - Putting the logic into methods to simplify running tasks in a pool of threads

As mentioned earlier, object-oriented code is one of the most valuable friends of multithreaded applications. We want the ThumbnailBrightnessAdjuster class to be simple, self-contained, and efficient. Achieving this will help us focus on parallelizing the requests and not on threading problems.

Now, we are going to add some methods to the ThumbnailBrightnessAdjuster class to complete the adjusted high quality thumbnail generation algorithm:

  1. Stay in the project, ImageBrowser.
  2. Open the code for the ThumbnailBrightnessAdjuster class.
  3. Add the following constructor:
    public ThumbnailBrightnessAdjuster(string parsImageFileName, Size paroThumbnailSize, double pariBrightnessAdjustment) ...

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