This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Apply blur only to a rectangular part of a bitmap

Hi all

Everything is in the title ... can someone provide me with a sample code to apply a gaussian blur only to a rectangular part of the picture (rectangle defined by its coordinates + dimensions).
Thanks in advance for your help

Phoceis
Try this:

Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap();
bitmap.Load(@"c:\temp\DSCF9099.jpg");

Aurigma.GraphicsMill.BitmapData data = bitmap.LockBits(100, 100, 600, 400);

Aurigma.GraphicsMill.Transforms.Blur blur = new Aurigma.GraphicsMill.Transforms.Blur();

blur.Type = Aurigma.GraphicsMill.Transforms.BlurType.Gaussian;
blur.Radius = 20;

blur.ApplyTransform(data);

bitmap.UnlockBits(data);

bitmap.Save(@"c:\result.jpg");

works perfectly thanks !