惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
S
Securelist
U
Unit 42
The Cloudflare Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Simon Willison's Weblog
Simon Willison's Weblog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
T
Tenable Blog
The Hacker News
The Hacker News
The Register - Security
The Register - Security
IT之家
IT之家
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
P
Privacy & Cybersecurity Law Blog
博客园_首页
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
A
Arctic Wolf
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
V2EX
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
V
Visual Studio Blog
月光博客
月光博客
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
G
GRAHAM CLULEY
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Heimdal Security Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - chengeng

让SVN可以修改提交log Python开发环境搭建 ubuntu 安装mysql Android Studio汉化备忘 DataConvert VS2022,IF条件为Flase也进入断点,设置方法 在CentOS上,查看CPU、内存和磁盘的指标命令 mysql 常用语句 MQTT服务器订阅消息例子 Java 异步调用方法 修改Web.config,IIS启动速度提升60倍 Windows smbv1共享协议开启 windows 10 激活 c#将一个类型对象数据赋值到另一个类型对象(名字相同的情况) 根据json内容更新表的一行,字段数量不固定,但名称需要一致 Windows 服务启动共享目录 FastReport 打印弹框,无法关闭(自己特定的场景,做个备忘,请勿参考) WinForm 指定时间没有操作键盘鼠标,弹出屏幕保护 MDns C# 实现 Makaretu.Dns.Multicast C#根据json内容动态生成SQL语句,字段数量可以不一样 金蝶云星空BOS平台官网知识 .Net Framework 离线安装包
WinForm截屏
chengeng · 2023-11-14 · via 博客园 - chengeng
 public void CutAppForm(int Localtion_X,int Localtion_Y, int picWidth,int picHeight,ref byte[] bytes)
 {
     string filePath = System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
     string fileName = DateTime.Now.ToString("yyyy?MM?dd?HH?mm?ss?") + ".jpg";
     try
     {
         Screen screen = Screen.AllScreens.FirstOrDefault();
         Rectangle rc = new Rectangle(Localtion_X, Localtion_Y, picWidth, picHeight);

         Bitmap bitmap = new Bitmap(rc.Width, rc.Height, PixelFormat.Format32bppArgb);
         this.DrawToBitmap(bitmap, rc);

         using (Graphics memoryGrahics = Graphics.FromImage(bitmap))
         {
             memoryGrahics.CopyFromScreen(rc.X, rc.Y, 0, 0, rc.Size, CopyPixelOperation.SourceCopy);//?????????????
         }
         bitmap.Save(filePath + fileName, ImageFormat.Png);
         MessageBox.Show("?????:" + filePath + fileName);

         MemoryStream ms = new MemoryStream();
         bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
         ms.Seek(0, System.IO.SeekOrigin.Begin);
         bytes = new byte[ms.Length];
         ms.Read(bytes, 0, bytes.Length);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }

 [System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
 public static extern bool BitBlt(IntPtr hdcDest, 
                                      int nXDest,
                                      int nYDest,
                                      int nWidth,
                                      int nHeight,
                                      IntPtr hdcSrc,  
                                      int nXSrc,
                                      int nYSrc,
                                      System.Int32 dwRop  
                                      );
}