I am running into a problem when using SetColorMatrix method in ImageAttributes class of GDI+ inside my VC++ code.

I am creating a color matrix and then for changing contrast of color image, I am doing a scaling on color matrix. Now I am applying this matrix to image attributes by using setcolormatrix call. After this I am seeing that CPU utilization reaches 100% and rest everything does not work as expected. Can we implement this in different way or this is the only method? Am I doing anything wrong?

Do I have to dispose the image attributes after I finish draw image call? If yes, then how can I accomplish this in VC++? I tried doing Reset after drawing this clears the contrast manipulation done but good thing is that it does not overload the CPU.