internal void SetElementCaptureProperties(string id, Bitmap bitmap, Color backgroundColor, Padding padding) { byte[] bytes = null; if (bitmap != null) { MemoryStream ms = new MemoryStream(); bitmap.Save(ms, ImageFormat.Bmp); ms.Seek(0, SeekOrigin.Begin); bytes = ms.ToArray(); } _elementCaptureProperties[id] = new ElementCaptureProperties(bytes, backgroundColor, padding); }