/// <summary> /// Sets the rendering settings if necessary. /// </summary> /// <param name="image">The image.</param> /// <param name="encoder">The encoder.</param> /// <param name="defaultRenderingSettings">The default rendering settings.</param> public static void SetRenderingSettingsIfNeed( VintasoftImage image, EncoderBase encoder, RenderingSettings defaultRenderingSettings) { if (encoder == null || !(encoder is IPdfEncoder)) { if (image.IsVectorImage) { RenderingSettingsForm settingsForm = new RenderingSettingsForm(defaultRenderingSettings.CreateClone()); if (settingsForm.ShowDialog() == DialogResult.OK) { image.RenderingSettings = settingsForm.RenderingSettings; } } } }
/// <summary> /// Sets the rendering settings if necessary. /// </summary> /// <param name="images">The images.</param> /// <param name="encoder">The encoder.</param> /// <param name="defaultRenderingSettings">The default rendering settings.</param> public static void SetRenderingSettingsIfNeed( ImageCollection images, EncoderBase encoder, RenderingSettings defaultRenderingSettings) { if (encoder == null || !(encoder is IPdfEncoder)) { for (int i = 0; i < images.Count; i++) { if (images[i].IsVectorImage) { RenderingSettingsForm settingsForm = new RenderingSettingsForm(defaultRenderingSettings.CreateClone()); if (settingsForm.ShowDialog() == DialogResult.OK) { images.SetRenderingSettings(settingsForm.RenderingSettings); } else { return; } break; } } } }
/// <summary> /// Applies settings to the image viewer. /// </summary> private void ApplySettings() { // image anchor _viewer.ImageAnchor = imageAnchorTypeEditor.SelectedAnchorType; // rendering quality _viewer.RenderingQuality = (ImageRenderingQuality)renderingQualityComboBox.SelectedItem; // focus point _viewer.FocusPointAnchor = focusPointAnchorTypeEditor.SelectedAnchorType; _viewer.IsFocusPointFixed = focusPointIsFixedCheckBox.Checked; // buffering _viewer.RendererCacheSize = (int)rendererCacheSizeNumericUpDown.Value; _viewer.ViewerBufferSize = (int)viewerBufferSizeNumericUpDown.Value; _viewer.MinImageSizeWhenZoomBufferUsed = (int)minImageSizeWhenZoomBufferUsedNumericUpDown.Value; // rendering _viewer.VectorRenderingQualityFactor = 1 + (vectorRenderingQualityFactorTrackBar.Value / 4f); if (_renderingSettings != null) { if (_viewer.ImageRenderingSettings == null) { _viewer.ImageRenderingSettings = _renderingSettings.CreateClone(); } else { _viewer.ImageRenderingSettings.InterpolationMode = _renderingSettings.InterpolationMode; _viewer.ImageRenderingSettings.SmoothingMode = _renderingSettings.SmoothingMode; _viewer.ImageRenderingSettings.Resolution = _renderingSettings.Resolution; _viewer.ImageRenderingSettings.OptimizeImageDrawing = _renderingSettings.OptimizeImageDrawing; } } if (_renderingRequirements != null) { _viewer.RenderingRequirements = _renderingRequirements; } _viewer.IntermediateImagePreviewInterval = (int)previewIntervalOfVectorImagesNumericUpDown.Value; _viewer.MaxThreadsForRendering = (int)maxThreadsNumericUpDown.Value; _viewer.RenderOnlyVisibleImages = renderOnlyVisibleImagesCheckBox.Checked; // backgroud color _viewer.BackColor = backgoundColorPanelControl.Color; // image display mode _viewer.MultipageDisplayMode = (ImageViewerMultipageDisplayMode)multipageDisplayModeComboBox.SelectedItem; _viewer.MultipageDisplayLayoutDirection = (ImagesLayoutDirection)layoutDirectionComboBox.SelectedItem; _viewer.MultipageDisplayRowCount = (int)imagesInRowColumnNumericUpDown.Value; _viewer.MultipageDisplayImagePadding = new PaddingF((float)imagesPaddingNumericUpDown.Value); _viewer.ImageAppearance = _imageAppearance; _viewer.FocusedImageAppearance = _focusedImageAppearance; _viewer.UseImageAppearancesInSinglePageMode = useImageAppearancesInSinglepageModeCheckBox.Checked; // keyboard _viewer.IsKeyboardNavigationEnabled = keyboardNavigationCheckBox.Checked; _viewer.KeyboardNavigationScrollStep = (int)keyboardNavigationScrollStepNumericUpDown.Value; _viewer.KeyboardNavigationZoomStep = (float)keyboardNavigationZoomStepNumericUpDown.Value; }