I am trying to make my code faster by using tasks (Parallel.foreach). Here is my updated code:
int intImageW, intImageH; Bitmap bmpDest = new Bitmap(1, 1); DateT
All your Tasks access to the same shared Bitmap bmpDest.
bmpDest
Move the definition of it to Parallel.ForEach block so that every task can use its own Bitmap..
Parallel.ForEach
Parallel.ForEach(strarrFileList, strJPGImagePath => { Bitmap bmpDest = new Bitmap(1, 1); ........ });