Hello, I am trying to extend the Bitmap class so that I can apply my own effects to an image. When I use this code:
namespace ImageEditor
{
public class Effects : System.Drawing.Bitmap
{
public void toBlackAndWhite()
{
System.Drawing.Bitmap image = (Bitmap)this;
AForge.Imaging.Filters.Grayscale filter = new AForge.Imaging.Filters.Grayscale();
this = filter.Apply(this);
}
}
}
I get the following error:
'ImageEditor.Effects': cannot derive from sealed type 'System.Drawing.Bitmap'
So is there a way to get around this or is it simply not possible to extend the class?
Thanks.