public void BuildOverlay(int width, int height, PixelFormat pixelFormat) { try { image.Dispose(); } catch { } image = new ImageManager(width, height, Color.Black, pixelFormat); image.Unlock(); for (int i = 0; i < objects.Length; i++) { Rectangle r = objects[i].ObjectBlob.Rectangle; Drawing.Rectangle(image.workingImage, r, Color.Red); for (int j = 1; j < thickness; j++) { r = new Rectangle(r.X - 1, r.Y - 1, r.Width + 2, r.Height + 2); Drawing.Rectangle(image.workingImage, r, Color.Red); } } image.Lock(); image.CopyDisplayToBacking(); }