首页 > 其他分享 >VideoWidget with pyqtgraph ImageView

VideoWidget with pyqtgraph ImageView

时间:2022-11-02 09:56:46浏览次数:53  
标签:None self pyqtgraph graphicsView QtWidgets import ImageView VideoWidget image

import time

from PySide6 import QtWidgets, QtGui, QtCore, QtOpenGLWidgets
from PySide6.QtGui import QOpenGLFunctions, QVector2D, QVector3D, QMatrix4x4
from PySide6.QtOpenGL import QOpenGLTexture, QOpenGLShader, QOpenGLShaderProgram
from PySide6.QtWidgets import QVBoxLayout
from pyqtgraph import ImageView

class VideoWidget(QtWidgets.QWidget):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
        # self.setAlignment(QtCore.Qt.AlignCenter)
        # 图像显示控件
        self.graphicsView = ImageView(self)
        # 隐藏直方图,菜单按钮,ROI
        self.graphicsView.ui.histogram.hide()
        self.graphicsView.ui.menuBtn.hide()
        self.graphicsView.ui.roiBtn.hide()

        self.verticalLayout = QVBoxLayout(self)
        self.verticalLayout.addWidget(self.graphicsView)
        # 设置窗口布局
        self.setLayout(self.verticalLayout)
        self.image_ = None
        self.ori_image = None
        if self.height() != 0:
            self.des_w_h_ratio_ = self.width() / self.height()
        self.src_w_h_ratio_ = float()
        self.scale_w_ = int()
        self.scale_h_ = int()
        self.last = 0.0
        self.texture = None
        self.texCoords = []
        self.vertices = []
        self.vshader = None
        self.vsrc = None
        self.fshader = None
        self.fsrc = None
        self.program = None
        pass

    def set_image(self, image):
        self.graphicsView.setImage(image)
        pass







标签:None,self,pyqtgraph,graphicsView,QtWidgets,import,ImageView,VideoWidget,image
From: https://www.cnblogs.com/kk0716/p/16850007.html

相关文章

  • VideoWidget
    fromPySide6importQtWidgets,QtGui,QtCore#classVideoWidget(QtOpenGLWidgets.QOpenGLWidget):classVideoWidget(QtWidgets.QWidget):def__init__(self,......
  • 快速缩略模板. ?imageView2/1/w/80/h/80
    通过 imageView2 接口提供常用图片处理模板。开发者根据业务需求,只需在下载URL后面附加相应的参数,就可以生成相应的缩略图。处理图片原图大小不超过32MB、宽高不超过30......
  • lui - imageViewer - 图片查看器
    imageViewer-图片查看器ImageViewerTableAttributes参数说明类型可选值默认值urlList图片列表Array—[]onChange图片切换、缩放、旋转回调函数......
  • 在QTdesigner界面中使用按钮切换pyqtgraph画图
    在QtDesigner中先建立UI,转成py文件,文件名为:plot_ui.py#-*-coding:utf-8-*-################################################################################......
  • pyqtgraph 内嵌到 Qtdesigner 设计界面中
    fromPySide6.QtWidgetsimportQApplication,QMainWindow,QWidgetimportpyqtgraphaspgimportsysfromPySide6importQtCore,QtWidgetsimportnumpyasnpfrom......
  • ImageView 用法总结
    结构继承关系publicclassView.OnClickListnerextendsView java.lang.Objectandroid.view.Viewandroid.widget.ImageView 直接子类ImageButton,QuickContactBadge ......