If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

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).

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.