// Token: 0x06000166 RID: 358 RVA: 0x00008440 File Offset: 0x00006640 public ScrapDrawForm(ScrapBase scrap) { InitializeComponent(); _scrap = scrap; _basepoint = new Point(50, 50); var p = new Point(scrap.ClientRectangle.X + scrap.ClientSize.Width / 2, scrap.ClientRectangle.Y + scrap.ClientSize.Height / 2); p = scrap.PointToScreen(p); _baseimg = new Bitmap(scrap.Image.Width + 100, scrap.Image.Height + 100, PixelFormat.Format24bppRgb); CopyFromScreen(_baseimg, new Point(p.X - scrap.Image.Width / 2 - 50, p.Y - scrap.Image.Height / 2 - 50)); var colorMatrix = new ColorMatrix(); var num = 0.298912f; var num2 = 0.586611f; var num3 = 0.114478f; colorMatrix[0, 0] = (colorMatrix[0, 1] = (colorMatrix[0, 2] = num * 0.5f)); colorMatrix[1, 0] = (colorMatrix[1, 1] = (colorMatrix[1, 2] = num2 * 0.5f)); colorMatrix[2, 0] = (colorMatrix[2, 1] = (colorMatrix[2, 2] = num3 * 0.5f)); colorMatrix[3, 3] = (colorMatrix[4, 4] = 1f); var imageAttributes = new ImageAttributes(); imageAttributes.SetColorMatrix(colorMatrix); using (var graphics = Graphics.FromImage(_baseimg)) { var p2 = new Point(scrap.ClientRectangle.Left, scrap.ClientRectangle.Top); p2 = scrap.PointToScreen(p2); graphics.DrawImageUnscaled(scrap.Image, 50, 50); graphics.DrawImage(_baseimg, new Rectangle(0, 0, _baseimg.Width, _baseimg.Height), 0, 0, _baseimg.Width, _baseimg.Height, GraphicsUnit.Pixel, imageAttributes); } base.Width = _baseimg.Width; base.Height = _baseimg.Height; base.Left = p.X - base.Width / 2; base.Top = p.Y - base.Height / 2; _scrap.Hide(); }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { if (this.Absolute) { if (this._opacity > 1.0) { scrap.ActiveOpacity = 1.0; } else if (this._opacity < 0.01) { scrap.ActiveOpacity = 0.01; } else { scrap.ActiveOpacity = this._opacity; } } else if ((scrap.ActiveOpacity + this._opacity) > 1.0) { scrap.ActiveOpacity = 1.0; } else if ((scrap.ActiveOpacity + this._opacity) < 0.01) { scrap.ActiveOpacity = 0.01; } else { scrap.ActiveOpacity += this._opacity; } }
// Token: 0x06000481 RID: 1153 RVA: 0x0001D84C File Offset: 0x0001BA4C protected override EncoderParameter[] GetEncoderParams(ref ScrapBase scrap) { return(new List <EncoderParameter> { new EncoderParameter(Encoder.Quality, 100) }.ToArray()); }
public override void Apply(ref ScrapBase scrap) { if (scrap.Manager != null) { scrap.Manager.HideAllScrap(); } }
public void RestoreScrap(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; List <ScrapBase> list = new List <ScrapBase>(); while (this.dustbox.Count > 0) { ScrapBase base2 = this.dustbox.Dequeue(); if (!base2.Equals(item.Tag)) { list.Add(base2); } else { this.scrapBook.AddScrap(base2); base2.Show(); } } this.dustbox.Clear(); foreach (ScrapBase base3 in list) { this.dustbox.Enqueue(base3); } new ScrapEventArgs(); }
public CompactScrap(ScrapBase scrap, CCompactStyleItem item, Point clickpoint) { this.InitializeComponent(); this._scrap = scrap; this._thumbnail = scrap.GetViewImage(); this._dragmode = false; if (clickpoint == Point.Empty) { this._clickpoint = new Point(base.Width / 2, base.Height / 2); } else { this._clickpoint = clickpoint; } this._pen = new Pen(Color.FromArgb(item.LineColor), 1f); if (!item.SoldLine) { this._pen.DashStyle = DashStyle.Dash; this._pen.DashPattern = new float[] { 4f, 4f }; } else { this._pen.DashStyle = DashStyle.Solid; } if (item.LineColor == Color.Fuchsia.ToArgb()) { this.BackColor = Color.Magenta; base.TransparencyKey = Color.Magenta; } base.Opacity = ((double)item.Opacity) / 100.0; }
void FormManager_Activated(Form form) { //Console.WriteLine("Activated:" + form); if (formDic.TryGetValue(form.Handle, out var formData)) { var sortingOrder = GetNextSortingOrder(); formData.SortingOrder = sortingOrder; ScrapBase scrapBase = null; if (form is ScrapBase scrap) { scrapBase = scrap; } else if (form is CompactScrap compact) { scrapBase = compact.scrap; } if (scrapBase != null) { scrapBase.CacheItem.SortingOrder = sortingOrder; scrapBase.CacheItem.SaveInfo(); } topMostFormData = formData; } }
protected override EncoderParameter[] GetEncoderParams(ref ScrapBase scrap) { List <EncoderParameter> list = new List <EncoderParameter>(); if (this.ShowPreview) { ImageJpegPreviewPanel panel; if (base.HaveMargin) { panel = new ImageJpegPreviewPanel(this, scrap.GetViewImage(), base.GetImageCodecInfo()); } else { panel = new ImageJpegPreviewPanel(this, (Bitmap)scrap.Image.Clone(), base.GetImageCodecInfo()); } if (panel.ShowDialog(scrap) != DialogResult.OK) { return(null); } CImageJpegStyleItem styleItem = (CImageJpegStyleItem)panel.StyleItem; list.Add(new EncoderParameter(Encoder.Quality, (long)styleItem.Quality)); } else { list.Add(new EncoderParameter(Encoder.Quality, (long)this.Quality)); } return(list.ToArray()); }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { using (ScrapPaintWindow window = new ScrapPaintWindow(scrap)) { window.ShowDialog(); } scrap.Refresh(); }
protected override EncoderParameter[] GetEncoderParams(ref ScrapBase scrap) { List <EncoderParameter> list = new List <EncoderParameter> { new EncoderParameter(Encoder.Quality, (long)this.Quality) }; return(list.ToArray()); }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { Point point = new Point(scrap.TargetLocation.X, scrap.TargetLocation.Y); point.X += this.Left; point.Y += this.Top; scrap.TargetLocation = point; }
public void ScrapKeyPress(object sender, ScrapKeyPressEventArgs e) { KeyItem item = this.keyBook.FindKeyItem(e.key); if (item != null) { ScrapBase scrap = (ScrapBase)sender; item.ParentStyle.Apply(ref scrap); } }
public virtual void Apply(ref ScrapBase scrap) { try { scrap.ApplyStyles(this.Items, Point.Empty); } catch (Exception exception) { Console.WriteLine("CStyle Apply Exception:" + exception.Message); } }
public virtual void Apply(ref ScrapBase scrap, Point clickpoint) { try { scrap.ApplyStyles(this, clickpoint); } catch (Exception exception) { Console.WriteLine("CStyle Apply Exception:" + exception.Message); } }
// Token: 0x060002BF RID: 703 RVA: 0x0000F53B File Offset: 0x0000D73B public override void Apply(ref ScrapBase scrap) { Layer.LayerManager.Instance.SuspendRefresh(); var result = MessageBox.Show(Mainform.Instance, "是否关闭所有截图", "提示", MessageBoxButtons.YesNo); Layer.LayerManager.Instance.ResumeRefresh(); if (result == DialogResult.Yes) { scrap.Manager.CloseAllScrap(); } }
public TrimWindow(ScrapBase scrap) : base(scrap) { this.penCenter = new Pen(Color.Gray); this.penCenter.DashStyle = DashStyle.Dot; this.TrimRight = scrap.Image.Width; this.TrimBottom = scrap.Image.Height; this.TrimLeft = 0; this.TrimTop = 0; this._locmouse = Locate.None; this._locsel = Locate.None; this._drag = false; }
// Token: 0x060003BC RID: 956 RVA: 0x0001684C File Offset: 0x00014A4C public TrimWindow(ScrapBase scrap) : base(scrap) { penCenter = new Pen(Color.Gray) { DashStyle = DashStyle.Dot }; TrimRight = scrap.Image.Width; TrimBottom = scrap.Image.Height; TrimLeft = 0; TrimTop = 0; _locmouse = TrimWindow.Locate.None; _locsel = TrimWindow.Locate.None; _drag = false; }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { using (Graphics graphics = Graphics.FromImage(scrap.Image)) { ColorMatrix newColorMatrix = new ColorMatrix { Matrix00 = -1f, Matrix11 = -1f, Matrix22 = -1f }; ImageAttributes imageAttr = new ImageAttributes(); imageAttr.SetColorMatrix(newColorMatrix); graphics.DrawImage(scrap.Image, new Rectangle(0, 0, scrap.Image.Width, scrap.Image.Height), 0, 0, scrap.Image.Width, scrap.Image.Height, GraphicsUnit.Pixel, imageAttr); } scrap.Refresh(); }
// Token: 0x06000352 RID: 850 RVA: 0x000158DC File Offset: 0x00013ADC public override void Apply(ref ScrapBase scrap, Point clickpoint) { var flag = false; var image = scrap.Image; var rotate = Rotate; if (rotate != 90) { if (rotate != 180) { if (rotate == 270) { image.RotateFlip(RotateFlipType.Rotate270FlipNone); flag = true; } } else { image.RotateFlip(RotateFlipType.Rotate180FlipNone); } } else { image.RotateFlip(RotateFlipType.Rotate90FlipNone); flag = true; } if (VerticalReflection) { image.RotateFlip(RotateFlipType.Rotate180FlipX); } if (HorizonReflection) { image.RotateFlip(RotateFlipType.RotateNoneFlipX); } if (flag) { var width = scrap.ClientSize.Width; var height = scrap.ClientSize.Height; var left = scrap.Location.X + (width - height) / 2; var top = scrap.Location.Y + (height - width) / 2; scrap.SuspendLayout(); scrap.ClientSize = new Size(height, width); scrap.Left = left; scrap.Top = top; scrap.ResumeLayout(); } scrap.Refresh(); }
// Token: 0x06000106 RID: 262 RVA: 0x00007664 File Offset: 0x00005864 public ScrapPaintWindow(ScrapBase scrap) : base(scrap) { base.SetStyle(ControlStyles.UserPaint, true); base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); isToolUse = false; activeTool = null; historyCommand = new List <ToolCommand>(); toolFrm = new ScrapPaintToolBar(this); toolFrm.KeyUp += layerForm_KeyUp; toolFrm.SelectTool += toolFrm_SelectTool; base.AddOwnedForm(toolFrm); layerForm = new ScrapPaintLayer(this); layerForm.KeyUp += layerForm_KeyUp; layerForm.SelectLayer += layerForm_SelectLayer; layerForm.LayerRefresh += layerForm_LayerRefresh; base.AddOwnedForm(layerForm); activeLayer = layerForm.SelectionLayer; }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { ScrapBase base2 = scrap; PicasaBar bar = new PicasaBar { SendImage = base2.Image, ID = this.ID, Pass = this.Pass, AlbumName = this.AlbumName, AlbumComment = this.AlbumComment, AlbumPublic = this.IsPublic, StartPosition = FormStartPosition.Manual, TopMost = true }; bar.Left = (scrap.Left + (scrap.Width / 2)) - (bar.Width / 2); bar.Top = (scrap.Top + (scrap.Height / 2)) - (bar.Height / 2); bar.Show(); }
public ScrapPaintWindow(ScrapBase scrap) : base(scrap) { base.SetStyle(ControlStyles.UserPaint, true); base.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.isToolUse = false; this.activeTool = null; this.historyCommand = new List <ToolCommand>(); this.toolFrm = new ScrapPaintToolBar(this); this.toolFrm.KeyUp += new KeyEventHandler(this.layerForm_KeyUp); this.toolFrm.SelectTool += new ScrapPaintToolBar.SelectToolDelegate(this.toolFrm_SelectTool); base.AddOwnedForm(this.toolFrm); this.layerForm = new ScrapPaintLayer(this); this.layerForm.KeyUp += new KeyEventHandler(this.layerForm_KeyUp); this.layerForm.SelectLayer += new ScrapPaintLayerItem.LayerDelegate(this.layerForm_SelectLayer); this.layerForm.LayerRefresh += new ScrapPaintLayerItem.LayerDelegate(this.layerForm_LayerRefresh); base.AddOwnedForm(this.layerForm); this.activeLayer = this.layerForm.SelectionLayer; }
// Token: 0x06000016 RID: 22 RVA: 0x000030E8 File Offset: 0x000012E8 public override void Apply(ref ScrapBase scrap, Point clickpoint) { var padding = scrap.Padding; switch (BorderStyle) { case 0: scrap.FormBorderStyle = FormBorderStyle.None; scrap.SolidFrame = false; padding.All = 1; scrap.BackColor = Color.FromArgb(25, 25, 25); scrap.ActiveMargin = padding.All; scrap.ShowInTaskbar = false; scrap.TopMost = true; break; case 1: scrap.FormBorderStyle = FormBorderStyle.None; scrap.SolidFrame = true; padding.All = MarginSize; scrap.BackColor = GetMarginColor(); scrap.ActiveMargin = padding.All; scrap.ShowInTaskbar = false; scrap.TopMost = true; return; case 2: if (scrap.FormBorderStyle != FormBorderStyle.FixedDialog) { scrap.FormBorderStyle = FormBorderStyle.FixedDialog; scrap.SolidFrame = true; padding.All = 0; scrap.BackColor = Color.Black; scrap.ActiveMargin = padding.All; scrap.ShowInTaskbar = true; scrap.TopMost = TopMost; return; } break; default: return; } }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { bool flag = false; Image image = scrap.Image; switch (this.Rotate) { case 90: image.RotateFlip(RotateFlipType.Rotate90FlipNone); flag = true; break; case 180: image.RotateFlip(RotateFlipType.Rotate180FlipNone); break; case 270: image.RotateFlip(RotateFlipType.Rotate270FlipNone); flag = true; break; } if (this.VerticalReflection) { image.RotateFlip(RotateFlipType.Rotate180FlipX); } if (this.HorizonReflection) { image.RotateFlip(RotateFlipType.RotateNoneFlipX); } if (flag) { int width = scrap.ClientSize.Width; int height = scrap.ClientSize.Height; int num3 = scrap.Location.X + ((width - height) / 2); int num4 = scrap.Location.Y + ((height - width) / 2); scrap.SuspendLayout(); scrap.ClientSize = new Size(height, width); scrap.Left = num3; scrap.Top = num4; scrap.ResumeLayout(); } scrap.Refresh(); }
public ScrapDrawForm(ScrapBase scrap) { float num4; float num6; float num8; this.InitializeComponent(); this._scrap = scrap; this._basepoint = new Point(50, 50); Point p = new Point(scrap.ClientRectangle.X + (scrap.ClientSize.Width / 2), scrap.ClientRectangle.Y + (scrap.ClientSize.Height / 2)); p = scrap.PointToScreen(p); this._baseimg = new Bitmap(scrap.Image.Width + 100, scrap.Image.Height + 100, PixelFormat.Format24bppRgb); this.CopyFromScreen(this._baseimg, new Point((p.X - (scrap.Image.Width / 2)) - 50, (p.Y - (scrap.Image.Height / 2)) - 50)); ColorMatrix newColorMatrix = new ColorMatrix(); float num = 0.298912f; float num2 = 0.586611f; float num3 = 0.114478f; newColorMatrix[0, 2] = num4 = num * 0.5f; newColorMatrix[0, 0] = newColorMatrix[0, 1] = num4; newColorMatrix[1, 2] = num6 = num2 * 0.5f; newColorMatrix[1, 0] = newColorMatrix[1, 1] = num6; newColorMatrix[2, 2] = num8 = num3 * 0.5f; newColorMatrix[2, 0] = newColorMatrix[2, 1] = num8; newColorMatrix[3, 3] = newColorMatrix[4, 4] = 1f; ImageAttributes imageAttr = new ImageAttributes(); imageAttr.SetColorMatrix(newColorMatrix); using (Graphics graphics = Graphics.FromImage(this._baseimg)) { Point point2 = new Point(scrap.ClientRectangle.Left, scrap.ClientRectangle.Top); point2 = scrap.PointToScreen(point2); graphics.DrawImageUnscaled(scrap.Image, 50, 50); graphics.DrawImage(this._baseimg, new Rectangle(0, 0, this._baseimg.Width, this._baseimg.Height), 0, 0, this._baseimg.Width, this._baseimg.Height, GraphicsUnit.Pixel, imageAttr); } base.Width = this._baseimg.Width; base.Height = this._baseimg.Height; base.Left = p.X - (base.Width / 2); base.Top = p.Y - (base.Height / 2); this._scrap.Hide(); }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { using (TrimWindow window = new TrimWindow(scrap)) { if (window.ShowDialog() == DialogResult.OK) { using (Bitmap bitmap = new Bitmap(window.TrimRectangle.Width, window.TrimRectangle.Height, PixelFormat.Format24bppRgb)) { using (Graphics graphics = Graphics.FromImage(bitmap)) { graphics.DrawImage(scrap.Image, 0, 0, new Rectangle(window.TrimLeft, window.TrimTop, window.TrimRectangle.Width, window.TrimRectangle.Height), GraphicsUnit.Pixel); } scrap.Image = bitmap; scrap.Left += window.TrimLeft; scrap.Top += window.TrimTop; scrap.Focus(); } } } scrap.Refresh(); }
void FormManager_Showed(Form form) { //Console.WriteLine("Showed:" + form); ; if (form != null) { var sortingOrder = 0; ScrapBase scrapBase = null; if (form is ScrapBase scrap) { scrapBase = scrap; } else if (form is CompactScrap compact) { scrapBase = compact.scrap; } if (scrapBase != null) { sortingOrder = scrapBase.CacheItem.SortingOrder; maxSortingOrder = Math.Max(sortingOrder, maxSortingOrder); scrapBase.CacheItem.SaveInfo(); } if (sortingOrder == 0) { sortingOrder = GetNextSortingOrder(); if (scrapBase != null) { scrapBase.CacheItem.SortingOrder = sortingOrder; scrapBase.CacheItem.SaveInfo(); } } formDic.Add(form.Handle, new FormData(form, sortingOrder)); } }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { Image img = null; if (Clipboard.ContainsImage()) { img = Clipboard.GetImage(); } else if (Clipboard.ContainsText()) { string text = Clipboard.GetText(); if (File.Exists(text)) { FileStream stream = null; try { stream = new FileStream(text, FileMode.Open, FileAccess.Read); img = (Bitmap)Image.FromStream(stream); stream.Close(); stream = null; } catch { } finally { if (stream != null) { stream.Close(); } } } } if (img != null) { scrap.Manager.AddScrap(img, scrap.Left, scrap.Top, img.Width, img.Height); } }
// Token: 0x060002BF RID: 703 RVA: 0x0000F53B File Offset: 0x0000D73B public override void Apply(ref ScrapBase scrap) { Image image = null; if (Clipboard.ContainsImage()) { image = Clipboard.GetImage(); } else if (Clipboard.ContainsText()) { var text = Clipboard.GetText(); if (File.Exists(text)) { FileStream fileStream = null; try { fileStream = new FileStream(text, FileMode.Open, FileAccess.Read); image = (Bitmap)Image.FromStream(fileStream); fileStream.Close(); fileStream = null; } catch { } finally { if (fileStream != null) { fileStream.Close(); } } } } if (image != null) { scrap.Manager.AddScrap(image, scrap.Left, scrap.Top, image.Width, image.Height); } }
public override void Apply(ref ScrapBase scrap, Point clickpoint) { if (this._fixed == ScaleSetType.Fixed) { scrap.Scale = this._scalevalue; } else { scrap.Scale += this._scalevalue; } if (this._interpolationmode != System.Drawing.Drawing2D.InterpolationMode.Invalid) { if (this._interpolationmode != System.Drawing.Drawing2D.InterpolationMode.Low) { scrap.InterpolationMode = this._interpolationmode; } else { switch (scrap.InterpolationMode) { case System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear: scrap.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; goto Label_0090; case System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic: scrap.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; goto Label_0090; case System.Drawing.Drawing2D.InterpolationMode.High: scrap.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBilinear; goto Label_0090; } scrap.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; } } Label_0090: scrap.Refresh(); }