通过一个软件导进了两张jpg类型的图片。
两张图片混合显示。
怎样将这两张混合显示的图片导出来(保存为一个文件)

解决方案 »

  1.   

    你可以用Alpha混合(本例用颜色转换矩阵):
        static void Blend()
        {
            Bitmap bm1 = new Bitmap("Autumn Leaves.jpg");                 //在示例图片文件夹中
            Bitmap bm2 = new Bitmap("Oryx Antelope.jpg");        using (Graphics g = Graphics.FromImage(bm1))
            {
                ColorMatrix colorMatrix = new ColorMatrix();
                colorMatrix.Matrix33 = 0.5f;                              //<---- 一个总体的Alpha值            ImageAttributes imgAttributes = new ImageAttributes();
                imgAttributes.SetColorMatrix(colorMatrix);            g.DrawImage(
                    bm2,
                    new Rectangle(0, 0, bm1.Width, bm2.Height),
                    0.0f,
                    0.0f,
                    bm2.Width,
                    bm2.Height,
                    GraphicsUnit.Pixel,
                    imgAttributes);
            }        bm1.Save(@"c:\temp\mixture.jpg");        bm1.Dispose();
            bm2.Dispose();       
        }
      

  2.   

    就是在一张图片上在贴上另一张图片 
    -------------------------------------
    div+css