public Image_Superimposition()
{
InitializeComponent();
// load an image
string fileName = "圖片1路徑";
System.Drawing.Bitmap image = (Bitmap)Bitmap.FromFile(fileName);

// create filter
Morph filter = new Morph(image);
filter.Percent = 0.3;//透明度

// apply filter
string fileName2 = "圖片2路徑";
System.Drawing.Bitmap sourceImage = (Bitmap)Bitmap.FromFile(fileName2);
Bitmap resultImage = filter.Apply(sourceImage);
pictureBox2.Image = resultImage;//最後影像以pictureBox2呈現
}

注意:兩個圖片的大小一定要一樣,不然程式會出現bug
arrow
arrow
    全站熱搜

    雀悦 發表在 痞客邦 留言(0) 人氣()