/// <summary> /// Updates the image size and format. /// </summary> /// <param name="resolution">The resolution.</param> private void SetImageParams(Resolution resolution) { int widthImage = Convert.ToInt32(widthImageNumericUpDown.Value); int heightImage = Convert.ToInt32(heightImageNumericUpDown.Value); _imageSize = ImageSize.FromPixels(widthImage, heightImage, resolution); _pixelFormat = (PixelFormat)pixelFormatComboBox.SelectedItem; }