All Projects → fandesfyf → Jamscreenshot

fandesfyf / Jamscreenshot

Licence: Apache-2.0 License
一个用python实现的类似微信QQ截屏的工具源码,整合提取自本人自制工具集Jamtools

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Jamscreenshot

JamTools
JamTools是一个跨平台的小工具集,包含了截屏、录屏、文字识别、各种格式转换、鼠标键盘动作录制播放、文件传输、聊天机器人等功能
Stars: ✭ 73 (+217.39%)
Mutual labels:  screenshot, pyqt5
ArcoLinux-dotfiles
ArcoLinux dotfiles for 2bwm / i3wm
Stars: ✭ 24 (+4.35%)
Mutual labels:  screenshot
vasisualy
Vasisualy it's a simple Russian voice assistant written on Python for GNU/Linux, Windows and Android.
Stars: ✭ 33 (+43.48%)
Mutual labels:  pyqt5
gpp-decrypt
Tool to parse the Group Policy Preferences XML file which extracts the username and decrypts the cpassword attribute.
Stars: ✭ 13 (-43.48%)
Mutual labels:  screenshot
SingleFile-Lite
Feel the power of the Manifest V3. The future, right now!
Stars: ✭ 55 (+139.13%)
Mutual labels:  screenshot
QtExamples
Translations of the official Qt examples into PyQt5 (also PySide2) and more.
Stars: ✭ 39 (+69.57%)
Mutual labels:  pyqt5
colorstorm
A color theme generator for editors and terminal emulators
Stars: ✭ 101 (+339.13%)
Mutual labels:  screenshot
PyQt-Sqlite-Project-CURD
Pyqt SQLite Project Have Features like Login, Add, Delete, Search, Update, Show the Students. In this, I show all the CURD operations of the Program. All Project is well represented and with interactive Toolbar & Menu bar. The database is included in the repository.
Stars: ✭ 41 (+78.26%)
Mutual labels:  pyqt5
broz
A simple, frameless browser for screenshots
Stars: ✭ 265 (+1052.17%)
Mutual labels:  screenshot
eddy
A graphical editor for the specification and visualization of Graphol ontologies
Stars: ✭ 24 (+4.35%)
Mutual labels:  pyqt5
awesome-www
Website of AwesomeWM
Stars: ✭ 39 (+69.57%)
Mutual labels:  screenshot
godot-engine.code-snapshot
A plugin for Godot Engine which will let you take beautified snapshots of your code within the Editor. Configure the frame as you like, with GDScript syntax already highlighted.
Stars: ✭ 32 (+39.13%)
Mutual labels:  screenshot
admbrowser
A Web browser for kiosks and digital signage, based on Python, PyQt, and Blink
Stars: ✭ 25 (+8.7%)
Mutual labels:  pyqt5
SteaScree
SteaScree: Steam Cloud Screenshot Uploader
Stars: ✭ 140 (+508.7%)
Mutual labels:  screenshot
urlbox-screenshots-node
Capture website thumbnails using the urlbox.io screenshot as a service API in node
Stars: ✭ 14 (-39.13%)
Mutual labels:  screenshot
larafeed
Laravel package for providing visual feedback via screenshots.
Stars: ✭ 42 (+82.61%)
Mutual labels:  screenshot
http-rider
Simple and Powerful desktop client for working with JSON APIs
Stars: ✭ 27 (+17.39%)
Mutual labels:  pyqt5
screenshotgun
Open cross-platform screenshoter with cloud support and server part
Stars: ✭ 23 (+0%)
Mutual labels:  screenshot
twitch-chat-visualizer
A Node.js Project. Would you like to see your chat stream with a custom design? This is for you!
Stars: ✭ 14 (-39.13%)
Mutual labels:  screenshot
screenshot-node
Takes a screenshot of selected area and saves it to disk
Stars: ✭ 20 (-13.04%)
Mutual labels:  screenshot

Jamscreenshot

一个用python实现的类似微信QQ截屏的工具源码, 来自本人自制工具集Jamtools里面的截屏部分整合,代码完全原创,分享出来 转载请标明出处!

如果你还需要滚动截屏功能,可以看看这个

----20210206更新------

新增了透视裁剪工具(类似于PS里的用法)、多边形截图工具、取色器工具、油漆桶工具、背景还原画笔(配合背景橡皮擦使用)、支持回退10步操作历史记录、新增一键还原按钮、新增智能选框的开关。画笔等增加透明度支持,在画笔/标记时可以通过按住ctrl键+滚轮快速调整画笔透明度,新增常用颜色到取色按钮(鼠标划过即可显示)、固定截屏在屏幕上时可以通过按住ctrl+滚轮快速调节截屏的透明度

效果图

加了一个简陋的主界面

image

截图效果: image

image

image

image 可以看到,几乎实现了微信截图的所有功能,还有一些微信截图没有的功能,像材质图片画笔、背景橡皮擦、所有颜色自选、画笔大小/放大镜倍数可通过滑轮调节等; 代码总长2000+行,直接运行即可!

-----------------2020.4.9更新--------------

更新: 支持把多个图片固定在屏幕上

支持窗口控件识别(基于opencv的轮廓识别功能),需要opencv库!

直接pip install opencv-python即可(滚动截屏需要安装contrib版本的opencv,版本小于opencv-contrib-python==3.4.2.17)

模块安装

主要使用的是PyQt5模块 直接 pip install PyQt5 即可 还需要PIL 直接pip install Pillow 即可

附带的jamresourse.py文件是图片资源文件(鼠标样式等)

提交环境为python3.7 pyqt5==5.13.2 win10 一切正常!

其他环境自行测试

说一说大概的思路吧

截屏流程:

先分析用户动作:用户点击截屏按钮(或按下快捷键)时截屏软件开始响应(通过一个按钮事件或者pyqtsignal,其实都是signal,来调用起截屏函数screen_shot),迅速截下当前屏幕的全屏内容(通过pyqt的grabWindow函数),同时显示截屏界面。

对截屏界面有几点说明:

1.截屏界面就是一个全屏窗口而已,该窗口是一个label类型的控件(因此可以直接将其当做背景层)有置顶、无边框、鼠标追踪等属性

2.截屏界面由背景层(Slabel本身)、绘图层(PaintLayer类)和遮罩层(MaskLayer类)依次堆叠而成,每一层都是一个Qlabel,绘图层和遮罩成以Slabel作为parent,并调用self.parent.xxx直接获得Slabel的属性。背景层用于显示之前截屏时的那个全屏内容,因为之前那个截屏是全屏幕截的,当前窗口又是全屏窗口,所以显示背景中的内容的位置就是之前在屏幕中实际的位置,而且这个时间很短,看起来的结果就像是用户直接操作在屏幕上一样;第二层是绘图层,有透明背景属性,用于用户进行涂鸦等操作(画笔中除了背景相关的画笔几乎都作用于这一层);最上面一层是遮罩层,该层主要用于显示截屏的阴影部分和方框(只是显示而已,背后的逻辑还是在它的parent即Slabel中)

区域截屏过程:在进入截屏界面后用户可以点击屏幕(该动作由mousePressEvent捕获),然后拖动(由mouseMoveEvent捕获),然后松开(由mouseReleaseEvent捕获),同时弹出确定按钮(botton_box)即可在界面上显示出选区界面。

关于选框参数,所有参数均在Slabel主类中设置,self.x0,x1,y0,y1是选区的对角坐标,在用户点击下鼠标左键时,记录下当前的位置,然后动鼠标时记录下鼠标位置,当松开鼠标时记录下松开的位置.注意每次点击/移动/松开鼠标都会调用update函数使得所有层(包括遮罩层)的界面更新(即自动调用了paintEvent函数)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].