Рисование ящиков на изображении с помощью PyQt? [Дубликат]

<html>
    <head>
        <title>HTML Document</title>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    </head>

    <body>
        <div id="hover-id">
            Hello World
        </div>

        <script>
            jQuery(document).ready(function($){
                $(document).on('mouseover', '#hover-id', function(){
                    $(this).css('color','yellowgreen');
                });

                $(document).on('mouseout', '#hover-id', function(){
                    $(this).css('color','black');
                });
            });
        </script>
    </body>
</html>
1
задан Senyokbalgul 4 April 2017 в 05:24
поделиться

1 ответ

# convert image file into pixmap
self.pixmap_image = QtGui.QPixmap(self.filename)

# create painter instance with pixmap
self.painterInstance = QtGui.QPainter(self.pixmap_image)

# set rectangle color and thickness
self.penRectangle = QtGui.QPen(QtCore.Qt.red)
self.penRedBorder.setWidth(3)

# draw rectangle on painter
self.painterInstance.setPen(self.penRectangle)
self.painterInstance.drawRect(xPos,yPos,xLen,yLen)

# set pixmap onto the label widget
self.ui.label_imageDisplay.setPixmap(self.pixmap_image)
self.ui.label_imageDisplay.show()
4
ответ дан Senyokbalgul 17 August 2018 в 20:24
поделиться
Другие вопросы по тегам:

Похожие вопросы: