资源简介
支持多个扩展显示器的截屏软件,内含Demo代码和工具源码,可以下载使用交流学习;包含支持配置快捷键,采用事件订阅的方式实现交互;
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
namespace _SCREEN_CAPTURE
{
[Designer(typeof(ColorBoxDesginer))]
public partial class ColorBox : Control
{
public ColorBox() {
InitializeComponent();
selectedColor = Color.Red;
m_rectSelected = new Rectangle(-100 -100 14 14);
this.Setstyle(Controlstyles.ResizeRedraw true);
this.Setstyle(Controlstyles.OptimizedDoubleBuffer true);
this.Setstyle(Controlstyles.AllPaintingInWmPaint true);
this.Setstyle(Controlstyles.UserPaint true);
this.Setstyle(Controlstyles.SupportsTransparentBackColor true);
}
private Color selectedColor;
public Color SelectedColor {
get { return selectedColor; }
}
private Point m_ptCurrent;
private Rectangle m_rectSelected;
private Bitmap m_clrImage = global::_SCREEN_CAPTURE.Properties.Resources.color;
private Color m_lastColor;
public delegate void ColorChangedHandler(object sender ColorChangedEventArgs e);
public event ColorChangedHandler ColorChanged;
protected virtual void OnColorChanged(ColorChangedEventArgs e) {
if (this.ColorChanged != null)
ColorChanged(this e);
}
protected override void onclick(EventArgs e) {
Color clr = m_clrImage.GetPixel(m_ptCurrent.X m_ptCurrent.Y);
if (clr.ToArgb() != Color.FromArgb(255 254 254 254).ToArgb()
&& clr.ToArgb() != Color.FromArgb(255 133 141 151).ToArgb()
&& clr.ToArgb() != Color.FromArgb(255 110 126 149).ToArgb()) {
if (this.selectedColor != clr)
this.selectedColor = clr;
this.Invalidate();
this.OnColorChanged(new ColorChangedEventArgs(clr));
}
base.onclick(e);
}
protected override void onmousemove(MouseEventArgs e) {
m_ptCurrent = e.Location;
try {
Color clr = m_clrImage.GetPixel(m_ptCurrent.X m_ptCurrent.Y);
if (clr != m_lastColor) {
if (clr.ToArgb() != Color.FromArgb(255 254 254 254).ToArgb()
&& clr.ToArgb() != Color.FromArgb(255 133 141 151).ToArgb()
&& clr.ToArgb() != Color.FromArgb(255 110 126 149).ToArgb()
&& e.X > 39) {
m_rectSelected.Y = e.Y > 17 ? 17 : 2;
m_rectSelected.X = ((e.X - 39) / 15) * 15 + 38;
this.Invalidate();
} else {
m_rectSelected.X = m_rectSelected.Y = -100;
this.Invalidate();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 83968 2018-03-05 15:40 AskMeScreenCapture\.vs\Askme_ScreenCapture\v14\.suo
文件 6844 2016-07-28 14:33 AskMeScreenCapture\Askme_ScreenCapture\Askme_ScreenCapture.csproj
文件 257 2016-04-28 16:02 AskMeScreenCapture\Askme_ScreenCapture\Askme_ScreenCapture.csproj.vspscc
文件 264192 2016-07-15 13:40 AskMeScreenCapture\Askme_ScreenCapture\bin\Debug\_SCREEN_CAPTURE.dll
文件 124416 2016-07-15 13:40 AskMeScreenCapture\Askme_ScreenCapture\bin\Debug\_SCREEN_CAPTURE.pdb
文件 260608 2016-04-26 16:13 AskMeScreenCapture\Askme_ScreenCapture\bin\Release\_SCREEN_CAPTURE.dll
文件 105984 2016-04-26 16:13 AskMeScreenCapture\Askme_ScreenCapture\bin\Release\_SCREEN_CAPTURE.pdb
文件 264192 2016-07-28 14:33 AskMeScreenCapture\Askme_ScreenCapture\bin\x86\Debug\_SCREEN_CAPTURE.dll
文件 124416 2016-07-28 14:33 AskMeScreenCapture\Askme_ScreenCapture\bin\x86\Debug\_SCREEN_CAPTURE.pdb
文件 260096 2016-10-27 12:41 AskMeScreenCapture\Askme_ScreenCapture\bin\x86\Release\_SCREEN_CAPTURE.dll
文件 112128 2016-10-27 12:41 AskMeScreenCapture\Askme_ScreenCapture\bin\x86\Release\_SCREEN_CAPTURE.pdb
文件 4309 2012-12-08 23:20 AskMeScreenCapture\Askme_ScreenCapture\ColorBox.cs
文件 1202 2012-12-03 22:32 AskMeScreenCapture\Askme_ScreenCapture\ColorBox.Designer.cs
文件 5817 2012-12-03 03:09 AskMeScreenCapture\Askme_ScreenCapture\ColorBox.resx
文件 390 2012-12-03 02:17 AskMeScreenCapture\Askme_ScreenCapture\ColorBoxDesginer.cs
文件 30602 2016-10-27 12:40 AskMeScreenCapture\Askme_ScreenCapture\FrmCapture.cs
文件 17212 2016-04-28 10:58 AskMeScreenCapture\Askme_ScreenCapture\FrmCapture.Designer.cs
文件 6184 2016-04-28 10:59 AskMeScreenCapture\Askme_ScreenCapture\FrmCapture.resx
文件 14169 2016-10-27 12:40 AskMeScreenCapture\Askme_ScreenCapture\FrmOut.cs
文件 7659 2013-01-24 00:02 AskMeScreenCapture\Askme_ScreenCapture\FrmOut.Designer.cs
文件 212946 2013-01-24 00:02 AskMeScreenCapture\Askme_ScreenCapture\FrmOut.resx
文件 2219 2016-04-27 15:47 AskMeScreenCapture\Askme_ScreenCapture\FrmSize.cs
文件 5720 2016-04-27 15:47 AskMeScreenCapture\Askme_ScreenCapture\FrmSize.Designer.cs
文件 5817 2016-04-27 15:47 AskMeScreenCapture\Askme_ScreenCapture\FrmSize.resx
文件 30382 2016-04-28 10:20 AskMeScreenCapture\Askme_ScreenCapture\ImageProcessBox.cs
文件 1043 2012-11-28 21:50 AskMeScreenCapture\Askme_ScreenCapture\ImageProcessBox.Designer.cs
文件 4402 2013-01-23 20:59 AskMeScreenCapture\Askme_ScreenCapture\MouseHook.cs
文件 2205 2016-07-15 13:40 AskMeScreenCapture\Askme_ScreenCapture\obj\Debug\Askme_ScreenCapture.csproj.FileListAbsolute.txt
文件 1654 2016-07-15 13:40 AskMeScreenCapture\Askme_ScreenCapture\obj\Debug\Askme_ScreenCapture.csproj.GenerateResource.Cache
文件 19291 2016-07-15 14:52 AskMeScreenCapture\Askme_ScreenCapture\obj\Debug\DesignTimeResolveAssemblyReferences.cache
............此处省略170个文件信息
评论
共有 条评论