How to apply or draw an effect

Coordinator
Jun 21, 2011 at 7:15 AM
Edited Jun 21, 2011 at 7:17 AM

Heres how to apply or draw a simple effect:

using GDIPlusX;
using GDIPlusX.GDIPlus11;
using GDIPlusX.GDIPlus11.Effects;
...

//     Apply effect to entire bitmap 

     Effect leEffect = new BlurEffect(5.0f, false);
     
     lbmpBitmap.ApplyEffect(leEffect, Rectangle.Empty);
     
//     -- OR --
//     Draw bitmap with effect
     
     Effect leEffect = new BlurEffect(5.0f, false);
     
     lgGraphics.DrawImage(
         lbmpBitmap, 
         new Rectangle(0, 0, lbmpBitmap.Width, lbmpBitmap.Height),
         leEffect,
         null,
         null,
         GraphicsUnit.Pixel);