C# Clone Image

Aku tengah buat image processing program ada masalah masa clone image. Image yang dah asal yang dah diclone dan diproses turut menjejaskan image asal. Jadi aku cari jumpa code ni :


public static Image cloneImage(Image srcImage){
if (srcImage == null) return null;
Bitmap copy = new Bitmap(srcImage);
using (Graphics g = Graphics.FromImage(copy))
{
g.DrawImage(srcImage,new Rectangle(0, 0, srcImage.Width, srcImage.Height));
}
return copy;
}

1 comments:

Zahanim said...

my goodness....
awak ni still macam dulu ekk...
so,this is ur blog haaa???
perghhh I really "LIKE" it .... hahaha anyway good luck!!

 
Copyright © peyotest