独自の効果を画像に適用できるように、Bitmap クラスを拡張しようとしています。このコードを使用すると:
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);
}
}
}
次のエラーが表示されます。
'ImageEditor.Effects': cannot derive from sealed type 'System.Drawing.Bitmap'
これを回避する方法はありますか、それとも単にクラスを拡張することはできませんか?
ありがとう。