private void Initializers() { selection = Selection.GetBoundsInt(); numericUpDownTopLeftX.Maximum = selection.Width - 1; numericUpDownTopLeftY.Maximum = selection.Height - 1; numericUpDownTopRightX.Maximum = selection.Width - 1; numericUpDownTopRightY.Maximum = selection.Height - 1; numericUpDownBottomRightX.Maximum = selection.Width - 1; numericUpDownBottomRightY.Maximum = selection.Height - 1; numericUpDownBottomLeftX.Maximum = selection.Width - 1; numericUpDownBottomLeftY.Maximum = selection.Height - 1; numericUpDown1.Maximum = selection.Width; numericUpDown2.Maximum = selection.Height; srcImage = EffectSourceSurface.CreateAliasedBitmap(selection); quadControl11.Image = srcImage; float quadBaseSize = this.AutoScaleDimensions.Width / 96f * 500f; float divisor = Math.Max(srcImage.Width, srcImage.Height) / quadBaseSize; uiImgBounds.Width = (int)Math.Round(srcImage.Width / divisor); uiImgBounds.Height = (int)Math.Round(srcImage.Height / divisor); uiImgBounds.X = (int)Math.Max(0, (quadBaseSize - uiImgBounds.Width) / 2f); uiImgBounds.Y = (int)Math.Max(0, (quadBaseSize - uiImgBounds.Height) / 2f); }
private void ConfigDialog_Load(object sender, EventArgs e) { brushcollection = new PngBrushCollection(Services, Smudge.RawName); CreateDefaultBrushes(); OnBrushesChanged(); for (int i = 0; i < brushcollection.Count; i++) { brushcombobox.Items.Add(brushcollection[i]); } brushcombobox.Items.Add("Add/Remove Brushes..."); this.BackColor = SystemColors.Control; this.Text = Smudge.StaticDialogName; surface = EffectSourceSurface.Clone(); canvas.Surface = surface; canvas.Selection = Selection; historystack = new HistoryStack(surface, false); InitializeRenderer(); this.DesktopLocation = Owner.PointToScreen(new Point(0, 30)); this.Size = new Size(Owner.ClientSize.Width, Owner.ClientSize.Height - 30); this.WindowState = Owner.WindowState; }