public static Bitmap subtractImage(Bitmap minuend, Bitmap deduction, int relativeX, int relativeY) { Bitmap b = minuend; Bitmap b1 = deduction; Bitmap random = new Bitmap(256, 256, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(random); g.DrawImage(b, new Point(0, 0)); g.Dispose(); Bitmap rec = new Bitmap(256, 256, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Graphics g1 = Graphics.FromImage(rec); g1.DrawImage(b1, new Point(0, 0)); g1.Dispose(); Bitmap result = new Bitmap(256, 256, System.Drawing.Imaging.PixelFormat.Format24bppRgb); // Bitmap r = new Bitmap(256, 256, , System.Drawing.Imaging.PixelFormat.Format24bppRgb, IntPtr.Size); //Bitmap rand=new Bitmap(pictureBox1.Image,256,256,System.Drawing.Imaging.PixelFormat.Format24bppRgb,IntPtr.Zero); //Bitmap rec = new Bitmap(pictureBox2.Image,System.Drawing.Imaging.PixelFormat.Format16bppGrayScale,IntPtr.Zero); //Bitmap result = new Bitmap(256, 256); Difference filter = new Difference(random); result = filter.Apply(rec); result.Save("d:\\result.bmp"); return result; }
pre
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)