IMage distortions when processing on anotehr thread
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: IMage distortions when processing on anotehr thread

  1. #1
    Join Date
    Jun 2008
    Posts
    2,477

    IMage distortions when processing on anotehr thread

    I wrote a small application to use as a sandbox for testing ideas that will end up in a production product. The idea is simple; use a TrackBar to change the overall brightness of an image. Because this process takes a fair amount of time, I need to do it in another thread (unless you have a better way). I cannot use the ColorMatrix class because it allows color component values to overflow and I cannot figure out how to clamp them at 255. Anyway, here is the problem:

    When I move the TrackBar slowly, everything works great. When I move the TrackBar quickly, the image becomes distorted. Horizontal bands appear across it, as if the image was processed using different scale factors. I don't know how this could be as I am drawing into a display bitmap using a base bitmap to get the color values, but I have *very* little experience with threading. I'm stuck at this point, so any help you guys could give would be much appreciated. The project is below (had to use filefront as it is too large for a forum attachment).

    http://files.filefront.com/13453973

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: IMage distortions when processing on anotehr thread

    NVM, I figured it out. I was allowing the scale factor to be set while the operation was in progress, even though I blocked the worker.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center