static void ClearBitmap(BitmapCanvas img) { Color c = Color.FromArgb(0); for (int y = 0; y < img.Height; y++) { for (int x = 0; x < img.Width; x++) { img.SetPixel(x, y, c); } } }
static void JoinBitmaps(BitmapCanvas bottom, BitmapCanvas top, BitmapCanvas dest) { int w = Min(bottom.Width, top.Width, dest.Width); int h = Min(bottom.Height, top.Height, dest.Height); for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { Color bc = bottom.GetPixel(x, y); Color tc = top.GetPixel(x, y); Color fin = tc.ToArgb() == 0 ? bc : tc; dest.SetPixel(x, y, fin); } } }