示例#1
0
        public static Image CreateNewImage(RegionCaptureOptions options, Form form = null)
        {
            using (NewImageForm newImageForm = new NewImageForm(options))
            {
                if (newImageForm.ShowDialog(form) == DialogResult.OK)
                {
                    Color backgroundColor;

                    if (options.EditorNewImageTransparent)
                    {
                        backgroundColor = Color.Transparent;
                    }
                    else
                    {
                        backgroundColor = options.EditorNewImageBackgroundColor;
                    }

                    return(ImageHelpers.CreateBitmap(options.EditorNewImageSize.Width, options.EditorNewImageSize.Height, backgroundColor));
                }
            }

            return(null);
        }