コード例 #1
0
ファイル: LevelsEffect.cs プロジェクト: vip57884381/Paint.Net
 public LevelsEffect()
     :
     base(PdnResources.GetString("LevelsEffect.Name"),
          PdnResources.GetImage("Icons.LevelsEffect.png"),
          true)
 {
 }
コード例 #2
0
ファイル: CurvesEffect.cs プロジェクト: leejungho2/xynotecgui
 public CurvesEffect()
     : base(PdnResources.GetString("CurvesEffect.Name"),
            PdnResources.GetImage("Icons.CurvesEffect.png"),
            null,
            EffectDirectives.None, true)
 {
 }
コード例 #3
0
ファイル: BlurEffect.cs プロジェクト: vip57884381/Paint.Net
 public BlurEffect()
     : base(StaticName,
            PdnResources.GetImage("Icons.BlurEffect.png"),
            PdnResources.GetString("Effects.Blurring.Submenu.Name"),
            EffectDirectives.None,
            true)
 {
 }
コード例 #4
0
 public OilPaintingEffect()
     : base(StaticName,
            PdnResources.GetImage("Icons.OilPaintingEffect.png"),
            null,
            EffectDirectives.None,
            true)
 {
 }
コード例 #5
0
 protected override void OnShown(EventArgs e)
 {
     base.PerformLayout();
     if (base.ShowInTaskbar)
     {
         Icon icon = PdnResources.GetImage("Images.Warning16.png").ToIcon(true);
         TaskbarManager.Instance.SetOverlayIcon(base.Handle, icon, null);
     }
     UIUtil.FlashForm(this);
     base.OnShown(e);
 }
コード例 #6
0
        private void RenderPdnDonateBannerImage(Graphics g, Rectangle rect)
        {
            g.Clear(Color.White);

            // Draw black outline
            g.DrawRectangle(Pens.Black, new Rectangle(rect.Left, rect.Top, rect.Width - 1, rect.Height - 1));

            // Draw the PayPal icon
            Image payPalDonate = PdnResources.GetImage("Images.PayPalDonate.gif");

            Rectangle payPalRect = new Rectangle(
                rect.Right - payPalDonate.Width - (rect.Height - payPalDonate.Width),
                rect.Top + (rect.Height - payPalDonate.Height) / 2,
                payPalDonate.Width,
                payPalDonate.Height);

            g.DrawImage(payPalDonate, payPalRect, new Rectangle(0, 0, payPalDonate.Width, payPalDonate.Height), GraphicsUnit.Pixel);

            // Draw the PDN icon
            Image pdnIcon = PdnResources.GetImage("Images.Icon50x50.png");

            Rectangle pdnIconRect = new Rectangle(
                rect.Left + (rect.Height - pdnIcon.Width) / 2,
                rect.Top + (rect.Height - pdnIcon.Height) / 2,
                pdnIcon.Width,
                pdnIcon.Height);

            g.DrawImage(pdnIcon, pdnIconRect, new Rectangle(0, 0, pdnIcon.Width, pdnIcon.Height), GraphicsUnit.Pixel);

            // Draw inset text
            using (StringFormat sf = (StringFormat)StringFormat.GenericTypographic.Clone())
            {
                using (Font donateFont = new Font(Font.FontFamily, 12, FontStyle.Underline, GraphicsUnit.Pixel))
                {
                    sf.Alignment     = StringAlignment.Center;
                    sf.LineAlignment = StringAlignment.Center;
                    string insetText = PdnResources.GetString("SetupWizard.InstallingPage.PdnDonateBannerImage.Text");

                    int insetMargin = 2;

                    Rectangle textRect = new Rectangle(
                        pdnIconRect.Right,
                        rect.Top + insetMargin,
                        rect.Width - insetMargin - (rect.Right - payPalRect.Left) - (pdnIcon.Width + insetMargin) - ((rect.Right - payPalRect.Left) - payPalDonate.Width),
                        rect.Height - insetMargin * 2);

                    g.DrawString(insetText, donateFont, Brushes.Blue, textRect, sf);
                }
            }

            return;
        }
コード例 #7
0
ファイル: SepiaEffect.cs プロジェクト: leejungho2/xynotecgui
        public SepiaEffect()
            : base(PdnResources.GetString("SepiaEffect.Name"),
                   PdnResources.GetImage("Icons.SepiaEffect.png"))
        {
            this.desaturate = new UnaryPixelOps.Desaturate();

            this.levels = new UnaryPixelOps.Level(
                ColorBgra.Black,
                ColorBgra.White,
                new float[] { 1.2f, 1.0f, 0.8f },
                ColorBgra.Black,
                ColorBgra.White);
        }
コード例 #8
0
        public LayerPropertiesDialog()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.MenuLayersLayerPropertiesIcon.png"), Color.FromArgb(192, 192, 192));

            this.Text = PdnResources.GetString("LayerPropertiesDialog.Text");
            this.VisibleCheckBox.Text = PdnResources.GetString("LayerPropertiesDialog.VisibleCheckBox.Text");
            this.NameLabel.Text       = PdnResources.GetString("LayerPropertiesDialog.NameLabel.Text");
            this._generalHeader.Text  = PdnResources.GetString("LayerPropertiesDialog.GeneralHeader.Text");
            this.cancelButton.Text    = PdnResources.GetString("Form.CancelButton.Text");
            this.OkButton.Text        = PdnResources.GetString("Form.OkButton.Text");
        }
コード例 #9
0
        public override void LoadResources()
        {
            this.Text = PdnResources.GetString("UpdatesOptionsDialog.Text");

            Image iconImage = PdnResources.GetImage("Icons.SettingsIcon.png");

            this.Icon = Utility.ImageToIcon(iconImage, Utility.TransparentKey, true);

            this.saveButton.Text          = PdnResources.GetString("UpdatesOptionsDialog.SaveButton.Text");
            this.autoCheckBox.Text        = PdnResources.GetString("UpdatesOptionsDialog.AutoCheckBox.Text");
            this.betaCheckBox.Text        = PdnResources.GetString("UpdatesOptionsDialog.BetaCheckBox.Text");
            this.allUsersNoticeLabel.Text = PdnResources.GetString("UpdatesOptionsDialog.AllUsersNoticeLabel.Text");
            this.cancelButton.Text        = PdnResources.GetString("Form.CancelButton.Text");

            base.LoadResources();
        }
コード例 #10
0
 public LayerPropertiesDialog()
 {
     base.SuspendLayout();
     base.AutoHandleGlassRelatedOptimizations = true;
     base.IsGlassDesired = !OS.IsWin10OrLater;
     this.DoubleBuffered = true;
     base.ResizeRedraw   = true;
     this.InitializeComponent();
     base.Icon = PdnResources.GetImage("Icons.MenuLayersLayerPropertiesIcon.png").ToIcon();
     this.Text = PdnResources.GetString("LayerPropertiesDialog.Text");
     this.visibleCheckBox.Text = PdnResources.GetString("LayerPropertiesDialog.VisibleCheckBox.Text");
     this.nameLabel.Text       = PdnResources.GetString("LayerPropertiesDialog.NameLabel.Text");
     this.generalHeader.Text   = PdnResources.GetString("LayerPropertiesDialog.GeneralHeader.Text");
     this.cancelButton.Text    = PdnResources.GetString("Form.CancelButton.Text");
     this.okButton.Text        = PdnResources.GetString("Form.OkButton.Text");
     base.ResumeLayout(false);
     base.PerformLayout();
 }
コード例 #11
0
        public SetupWizard()
        {
            this.SuspendLayout();

            using (Graphics g = this.CreateGraphics())
            {
                this.xScale = g.DpiX / 96.0f;
                this.yScale = g.DpiY / 96.0f;
            }

            UI.InitScaling(this);

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.ResumeLayout(false);

            this.languageIcon.Image = PdnResources.GetImage("Icons.MenuHelpLanguageIcon.png");

            LoadResources();
        }
コード例 #12
0
        public UpdatesDialog()
        {
            InitializeComponent();

            Image iconImage = PdnResources.GetImage("Icons.MenuHelpCheckForUpdatesIcon.png");

            this.Icon = Utility.ImageToIcon(iconImage, Utility.TransparentKey, true);

            if (Security.IsAdministrator)
            {
                this.optionsButton.Enabled = true;
            }
            else if (Security.CanElevateToAdministrator)
            {
                this.optionsButton.Enabled = true;
            }
            else
            {
                this.optionsButton.Enabled = false;
            }

            this.optionsButton.FlatStyle = FlatStyle.System;
            SystemLayer.UI.EnableShield(this.optionsButton, true);
        }
コード例 #13
0
 public EdgeDetectEffect()
     : base(StaticName,
            PdnResources.GetImage("Icons.EdgeDetectEffect.png"),
            true)
 {
 }
コード例 #14
0
 public PixelateEffect()
     : base(StaticName,
            PdnResources.GetImage("Icons.PixelateEffect.png"),
            true)
 {
 }
コード例 #15
0
 public BrightnessAndContrastAdjustment()
     : base(StaticName,
            PdnResources.GetImage("Icons.BrightnessAndContrastAdjustment.png"),
            true)
 {
 }
コード例 #16
0
 public AutoLevelEffect()
     : base(PdnResources.GetString("AutoLevel.Name"),
            PdnResources.GetImage("Icons.AutoLevel.png"))
 {
 }
コード例 #17
0
        public Int32ColorWheelPropertyControl(PropertyControlInfo propInfo)
            : base(propInfo)
        {
            if (Property.MinValue != requiredMin || Property.MaxValue != requiredMax)
            {
                throw new ArgumentException("The only range allowed for this control is [" + requiredMin + ", " + requiredMax + "]");
            }

            SuspendLayout();

            this.header             = new HeaderLabel();
            this.header.Name        = "header";
            this.header.RightMargin = 0;
            this.header.Text        = this.DisplayName;

            this.colorRectangle          = new ColorRectangleControl();
            this.colorRectangle.Name     = "colorRectangle";
            this.colorRectangle.TabStop  = false;
            this.colorRectangle.TabIndex = 0;

            this.hsvColorWheel               = new ColorWheel();
            this.hsvColorWheel.Name          = "hsvColorWheel";
            this.hsvColorWheel.ColorChanged += new EventHandler(HsvColorWheel_ColorChanged);
            this.hsvColorWheel.TabStop       = false;
            this.hsvColorWheel.TabIndex      = 1;

            this.saturationSlider               = new ColorGradientControl();
            this.saturationSlider.Name          = "saturationSlider";
            this.saturationSlider.Orientation   = Orientation.Vertical;
            this.saturationSlider.ValueChanged += new IndexEventHandler(SaturationSlider_ValueChanged);
            this.saturationSlider.TabStop       = false;
            this.saturationSlider.TabIndex      = 2;

            this.valueSlider               = new ColorGradientControl();
            this.valueSlider.Name          = "valueSlider";
            this.valueSlider.Orientation   = Orientation.Vertical;
            this.valueSlider.ValueChanged += new IndexEventHandler(ValueSlider_ValueChanged);
            this.valueSlider.TabStop       = false;
            this.valueSlider.TabIndex      = 3;

            this.redLabel          = new Label();
            this.redLabel.Name     = "redLabel";
            this.redLabel.AutoSize = true;
            this.redLabel.Text     = PdnResources.GetString("ColorsForm.RedLabel.Text");

            this.redNud               = new PdnNumericUpDown();
            this.redNud.Name          = "redNud";
            this.redNud.Minimum       = 0;
            this.redNud.Maximum       = 255;
            this.redNud.TextAlign     = HorizontalAlignment.Right;
            this.redNud.ValueChanged += new EventHandler(RedNud_ValueChanged);
            this.redNud.TabIndex      = 4;

            this.greenLabel          = new Label();
            this.greenLabel.Name     = "greenLabel";
            this.greenLabel.AutoSize = true;
            this.greenLabel.Text     = PdnResources.GetString("ColorsForm.GreenLabel.Text");

            this.greenNud               = new PdnNumericUpDown();
            this.greenNud.Name          = "greenNud";
            this.greenNud.Minimum       = 0;
            this.greenNud.Maximum       = 255;
            this.greenNud.TextAlign     = HorizontalAlignment.Right;
            this.greenNud.ValueChanged += new EventHandler(GreenNud_ValueChanged);
            this.greenNud.TabIndex      = 5;

            this.blueLabel          = new Label();
            this.blueLabel.Name     = "blueLabel";
            this.blueLabel.AutoSize = true;
            this.blueLabel.Text     = PdnResources.GetString("ColorsForm.BlueLabel.Text");

            this.blueNud               = new PdnNumericUpDown();
            this.blueNud.Name          = "blueNud";
            this.blueNud.Minimum       = 0;
            this.blueNud.Maximum       = 255;
            this.blueNud.TextAlign     = HorizontalAlignment.Right;
            this.blueNud.ValueChanged += new EventHandler(BlueNud_ValueChanged);
            this.blueNud.TabIndex      = 6;

            this.resetButton           = new Button();
            this.resetButton.AutoSize  = true;
            this.resetButton.Name      = "resetButton";
            this.resetButton.FlatStyle = FlatStyle.Standard;
            this.resetButton.Click    += new EventHandler(ResetButton_Click);
            this.resetButton.Image     = PdnResources.GetImage("Icons.ResetIcon.png");
            this.resetButton.Width     = 1;
            this.resetButton.Visible   = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
            this.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
            this.resetButton.TabIndex = 7;

            this.description      = new Label();
            this.description.Name = "description";
            this.description.Text = this.Description;

            this.Controls.AddRange(
                new Control[]
            {
                this.header,
                this.hsvColorWheel,
                this.saturationSlider,
                this.valueSlider,
                this.colorRectangle,
                this.redLabel,
                this.redNud,
                this.greenLabel,
                this.greenNud,
                this.blueLabel,
                this.blueNud,
                this.resetButton,
                this.description
            });

            ResumeLayout(false);
        }
コード例 #18
0
 public DesaturateEffect()
     : base(PdnResources.GetString("DesaturateEffect.Name"),
            PdnResources.GetImage("Icons.DesaturateEffect.png"))
 {
     this.desaturateOp = new UnaryPixelOps.Desaturate();
 }
コード例 #19
0
ファイル: FileMenu.cs プロジェクト: vip57884381/Paint.Net
        private void MenuFileOpenRecent_DropDownOpening(object sender, System.EventArgs e)
        {
            AppWorkspace.MostRecentFiles.LoadMruList();
            MostRecentFile[] filesReverse = AppWorkspace.MostRecentFiles.GetFileList();
            MostRecentFile[] files        = new MostRecentFile[filesReverse.Length];
            int i;

            for (i = 0; i < filesReverse.Length; ++i)
            {
                files[files.Length - i - 1] = filesReverse[i];
            }

            foreach (ToolStripItem mi in menuFileOpenRecent.DropDownItems)
            {
                mi.Click -= new EventHandler(MenuFileOpenRecentFile_Click);
            }

            menuFileOpenRecent.DropDownItems.Clear();

            i = 0;

            foreach (MostRecentFile mrf in files)
            {
                string menuName;

                if (i < 9)
                {
                    menuName = "&";
                }
                else
                {
                    menuName = "";
                }

                menuName += (1 + i).ToString() + " " + Path.GetFileName(mrf.FileName);
                ToolStripMenuItem mi = new ToolStripMenuItem(menuName);
                mi.Click       += new EventHandler(MenuFileOpenRecentFile_Click);
                mi.ImageScaling = ToolStripItemImageScaling.None;
                mi.Image        = (Image)mrf.Thumb.Clone();
                menuFileOpenRecent.DropDownItems.Add(mi);
                ++i;
            }

            if (menuFileOpenRecent.DropDownItems.Count == 0)
            {
                ToolStripMenuItem none = new ToolStripMenuItem(PdnResources.GetString("Menu.File.OpenRecent.None"));
                none.Enabled = false;
                menuFileOpenRecent.DropDownItems.Add(none);
            }
            else
            {
                ToolStripSeparator separator = new ToolStripSeparator();
                menuFileOpenRecent.DropDownItems.Add(separator);

                ToolStripMenuItem clearList = new ToolStripMenuItem();
                clearList.Text = PdnResources.GetString("Menu.File.OpenRecent.ClearThisList");
                menuFileOpenRecent.DropDownItems.Add(clearList);
                Image deleteIcon = PdnResources.GetImage("Icons.MenuEditEraseSelectionIcon.png");
                clearList.ImageTransparentColor = Utility.TransparentKey;
                clearList.ImageAlign            = ContentAlignment.MiddleCenter;
                clearList.ImageScaling          = ToolStripItemImageScaling.None;
                int    iconSize = AppWorkspace.MostRecentFiles.IconSize;
                Bitmap bitmap   = new Bitmap(iconSize + 2, iconSize + 2);

                using (Graphics g = Graphics.FromImage(bitmap))
                {
                    g.Clear(clearList.ImageTransparentColor);

                    Point offset = new Point((bitmap.Width - deleteIcon.Width) / 2,
                                             (bitmap.Height - deleteIcon.Height) / 2);

                    g.CompositingMode = CompositingMode.SourceCopy;
                    g.DrawImage(deleteIcon, offset.X, offset.Y, deleteIcon.Width, deleteIcon.Height);
                }

                clearList.Image  = bitmap;
                clearList.Click += new EventHandler(ClearList_Click);
            }
        }
コード例 #20
0
 public RedEyeRemoveEffect()
     : base(PdnResources.GetString("RedEyeRemoveEffect.Name"),
            PdnResources.GetImage("Icons.RedEyeRemoveEffect.png"),
            true)
 {
 }
コード例 #21
0
 public EmbossEffect()
     : base(StaticName,
            PdnResources.GetImage("Icons.EmbossEffect.png"),
            true)
 {
 }
コード例 #22
0
 public InvertColorsEffect()
     : base(PdnResources.GetString("InvertColorsEffect.Name"),
            PdnResources.GetImage("Icons.InvertColorsEffect.png"))
 {
     this.invertOp = new UnaryPixelOps.Invert();
 }
コード例 #23
0
 public Int32ColorWheelPropertyControl(PropertyControlInfo propInfo) : base(propInfo)
 {
     if ((base.Property.MinValue != 0) || (base.Property.MaxValue != 0xffffff))
     {
         object[] objArray1 = new object[] { "The only range allowed for this control is [", 0, ", ", 0xffffff, "]" };
         throw new ArgumentException(string.Concat(objArray1));
     }
     base.SuspendLayout();
     this.header                         = new HeadingLabel();
     this.header.Name                    = "header";
     this.header.RightMargin             = 0;
     this.header.Text                    = base.DisplayName;
     this.colorRectangle                 = new ColorRectangleControl();
     this.colorRectangle.Name            = "colorRectangle";
     this.colorRectangle.TabStop         = false;
     this.colorRectangle.TabIndex        = 0;
     this.hsvColorWheel                  = new ColorWheel();
     this.hsvColorWheel.Name             = "hsvColorWheel";
     this.hsvColorWheel.ColorChanged    += new EventHandler(this.OnHsvColorWheelColorChanged);
     this.hsvColorWheel.TabStop          = false;
     this.hsvColorWheel.TabIndex         = 1;
     this.saturationSlider               = new ColorGradientControl();
     this.saturationSlider.Name          = "saturationSlider";
     this.saturationSlider.Orientation   = Orientation.Vertical;
     this.saturationSlider.ValueChanged += new IndexEventHandler(this.OnSaturationSliderValueChanged);
     this.saturationSlider.TabStop       = false;
     this.saturationSlider.TabIndex      = 2;
     this.valueSlider                    = new ColorGradientControl();
     this.valueSlider.Name               = "valueSlider";
     this.valueSlider.Orientation        = Orientation.Vertical;
     this.valueSlider.ValueChanged      += new IndexEventHandler(this.OnValueSliderValueChanged);
     this.valueSlider.TabStop            = false;
     this.valueSlider.TabIndex           = 3;
     this.redLabel                       = new PdnLabel();
     this.redLabel.Name                  = "redLabel";
     this.redLabel.AutoSize              = true;
     this.redLabel.Text                  = PdnResources.GetString("ColorsForm.RedLabel.Text");
     this.redNud                         = new PdnNumericUpDown();
     this.redNud.Name                    = "redNud";
     this.redNud.Minimum                 = decimal.Zero;
     this.redNud.Maximum                 = 255M;
     this.redNud.TextAlign               = HorizontalAlignment.Right;
     this.redNud.ValueChanged           += new EventHandler(this.OnRedNudValueChanged);
     this.redNud.TabIndex                = 4;
     this.greenLabel                     = new PdnLabel();
     this.greenLabel.Name                = "greenLabel";
     this.greenLabel.AutoSize            = true;
     this.greenLabel.Text                = PdnResources.GetString("ColorsForm.GreenLabel.Text");
     this.greenNud                       = new PdnNumericUpDown();
     this.greenNud.Name                  = "greenNud";
     this.greenNud.Minimum               = decimal.Zero;
     this.greenNud.Maximum               = 255M;
     this.greenNud.TextAlign             = HorizontalAlignment.Right;
     this.greenNud.ValueChanged         += new EventHandler(this.OnGreenNudValueChanged);
     this.greenNud.TabIndex              = 5;
     this.blueLabel                      = new PdnLabel();
     this.blueLabel.Name                 = "blueLabel";
     this.blueLabel.AutoSize             = true;
     this.blueLabel.Text                 = PdnResources.GetString("ColorsForm.BlueLabel.Text");
     this.blueNud                        = new PdnNumericUpDown();
     this.blueNud.Name                   = "blueNud";
     this.blueNud.Minimum                = decimal.Zero;
     this.blueNud.Maximum                = 255M;
     this.blueNud.TextAlign              = HorizontalAlignment.Right;
     this.blueNud.ValueChanged          += new EventHandler(this.OnBlueNudValueChanged);
     this.blueNud.TabIndex               = 6;
     this.resetButton                    = new PdnPushButton();
     this.resetButton.AutoSize           = true;
     this.resetButton.Name               = "resetButton";
     this.resetButton.Click             += new EventHandler(this.OnResetButtonClick);
     this.resetButton.Image              = PdnResources.GetImage("Icons.ResetIcon.png");
     this.resetButton.Width              = 1;
     this.resetButton.Visible            = (bool)propInfo.ControlProperties[ControlInfoPropertyNames.ShowResetButton].Value;
     base.ToolTip.SetToolTip(this.resetButton, PdnResources.GetString("Form.ResetButton.Text").Replace("&", ""));
     this.resetButton.TabIndex = 7;
     this.description          = new PdnLabel();
     this.description.Name     = "description";
     this.description.Text     = base.Description;
     Control[] controls = new Control[] { this.header, this.hsvColorWheel, this.saturationSlider, this.valueSlider, this.colorRectangle, this.redLabel, this.redNud, this.greenLabel, this.greenNud, this.blueLabel, this.blueNud, this.resetButton, this.description };
     base.Controls.AddRange(controls);
     base.ResumeLayout(false);
 }