Quote Originally Posted by DryBone View Post
I need to blur a portion of the bitmap so I have changed the call to pvBlurChannel as you suggested to include the bounding rectangle, but it doesn't work.
I get a black rectangle instead.
Can you check this for me?
Yes, there is a non-obvious precondition for partial blur to work -- the dimensions of the dblBuffer array has to match the dimensions of the rectangle you are passing for processing to pvBlurChannel. The original description to "just" pass the rectangle to pvBlurChannel is misleading.

For instance if the rectangle is from (50, 50) to (399, 399) then the dimensions of dblBuffer has to be 350 by 350 too, i.e. use something like this

ReDim dblBuffer(0 To lWidth - 1, 0 To lHeight - 1) As Double


for this

pvBlurChannel(uData.Scan0, uData.Stride \ 4, lLeft, lTop, lWidth, lHeight, sngRadius, 0, dblBuffer)


to work on (lLeft, lTop) - (lLeft+lWidth-1, lTop+lHeight-1) rectangle.

LaVolpe's approach is viable too but I didn't think about it when designing pvBlurChannel helper function.

cheers,
</wqw>