Home > other >  GraphicsView display images
GraphicsView display images

Time:10-01

I use Qt GraphicsView display a picture, the code is as follows:

SRC=https://bbs.csdn.net/topics/cv2.imread (" D: \ \ 1. JPG ")
# img SRC=[1650, 2400, 2150:3500]
Img=cv2. CvtColor (img, cv2 COLOR_BGR2RGB)
X=img. Shape [1]
Y=img. Shape [0]
Frame=QtGui. QImage (img, x, y, QtGui. QImage. Format_RGB888)
Pix=QtGui. QPixmap. FromImage (frame)
The self. The scene=QGraphicsScene ()
Self. Scene. AddPixmap (pix)
Self. GraphicsView. SetScene (self. Scene)

If there is no the second sentence (img=SRC/1650:2400, 2150:3500), the normal display images, added a second part of the interception of the original image, the display when tilted 45 degrees to the right picture, is this why?

CodePudding user response:

His cap, which master can give directions?
  • Related