I have created a class which embed a GdPictureImaging as member and a "int" for image Id.
I wanted to implement the ICloneable interface in order to create a new instance of my class.
My problem is how to achieve this clone that will duplicate the GdPictureImaging and the associate image id.
Code: Select all
public class MyImage : ICloneable
{
private GdPictureImaging _gdPictureImaging = new GdPictureImaging();
private int _image = -1;
public MyImage(System.Drawing.Image image)
{
_image = _gdPictureImaging.CreateGdPictureImageFromBitmap(image as Bitmap);
}
public object Clone()
{
// how to return a new instance of MyImage
return ???
}
}
Frédéric