资源简介
python+pyqt5绘图,显示图像,播放视频的图形界面程序

代码片段和文件信息
# -*- coding: utf-8 -*-
from gui_demo_ui import Ui_Form
from PyQt5.QtWidgets import QWidget QFileDialog
from PyQt5.QtCore import QTimer
import cv2
import numpy as np
from matplotlib.patches import Rectangle
import time
import os
class demoWindows(QWidget):
def __del__(self):
self.camera.release()# 释放资源
if self.out_release_flag:
self.out.release()
def init_fun(self):
self.window = Ui_Form()
self.window.setupUi(self)
self.showandhideframe()
self.timer = QTimer()# 定义一个定时器对象
self.timer.timeout.connect(self.timer_fun) #计时结束调用方法
self.window.pushButton_2.clicked.connect(self.timer_start)# 这几行就是绑定按键的处理事件
self.window.pushButton_3.clicked.connect(self.recod_image)
self.window.pushButton_4.clicked.connect(self.timer_stop)
self.window.pushButton_5.clicked.connect(self.outfilespath_fun)
self.out_release_flag = False
self.tmp_img = np.zeros((72010803) np.uint8)
self.window.comboBox_type.currentIndexChanged.connect(self.showandhideframe)
self.window.OK_Btn.clicked.connect(self.draw_lines_fun)
self.window.pushButton.clicked.connect(self.open_btn_fun)
self.window.figure1.canvas.mpl_connect(“button_press_event“ self.figure1_on_press)# 绑定鼠标按下事件
self.window.figure1.canvas.mpl_connect(“button_release_event“ self.figure1_on_release)# 绑定鼠标松下按键
‘‘‘
showandhideframe():这个函数使用来根据选择绘制类型进行显示对应的参数
‘‘‘
def showandhideframe(self):
if self.window.comboBox_type.currentText() == “直线“:
self.window.frame_line_range.show()
self.window.frame_yuan.hide()
self.window.frame_tuoyuan.hide()
self.window.frame_wenzi.hide()
# print(self.comboBox_type.currentText())
elif self.window.comboBox_type.currentText() == “矩形“:
self.window.frame_line_range.show()
self.window.frame_yuan.hide()
self.window.frame_tuoyuan.hide()
self.window.frame_wenzi.hide()
elif self.window.comboBox_type.currentText() == “圆“:
self.window.frame_line_range.hide()
self.window.frame_yuan.show()
self.window.frame_tuoyuan.hide()
self.window.frame_wenzi.hide()
elif self.window.comboBox_type.currentText() == “椭圆“:
self.window.frame_line_range.hide()
self.window.frame_yuan.hide()
self.window.frame_tuoyuan.show()
self.window.frame_wenzi.hide()
elif self.window.comboBox_type.currentText() == “文字“:
self.window.frame_line_range.hide()
self.window.frame_yuan.hide()
self.window.frame_tuoyuan.hide()
self.window.frame_wenzi.show()
else:
# print(self.comboBox_type.currentText())
self.window.frame_line_range.hide()
self.window.frame_yuan.hide()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-08 21:55 chat\__pycache__\
文件 13670 2018-10-08 21:37 chat\__pycache__\gui_demo_ui.cpython-36.pyc
文件 46909 2018-10-08 21:37 chat\gui_demo.ui
文件 10886 2018-10-08 22:50 chat\gui_demo_fun.py
文件 31414 2018-10-08 21:37 chat\gui_demo_ui.py
目录 0 2019-01-09 11:22 chat\
- 上一篇:karmarkar.py
- 下一篇:球面拟合-基于最小二乘法
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 15个pyqt5项目
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- pyqt5动态加载ui文件,动态加载背景图
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
评论
共有 条评论