Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4387

Camera board • How to Overlay Translucent Shapes on Picamera2 Preview.QT

$
0
0
I'm currently using Picamera2 and Preview.QT with a USB camera.

While I could overlay an image and a transparent array, I could not overlay translucent shapes, and overlay multiple layers with cam2.set_overlay.

I tried running this on the interpreter but it could never work:

Code:

def circle():painter = QPainter()painter.setRenderHint(QPainter.RenderHint.Antialiasing)painter.setPen(QColor(255, 0, 0))painter.setBrush(QColor(255, 0, 0, 100))center_x, center_y = 320, 240radius = 50painter.drawEllipse(190, 270, 100, 100)overlay = circle()picam2.set_overlay(overlay)
Thanks for your help!

Statistics: Posted by bwnjcu1h — Fri Mar 07, 2025 5:11 am — Replies 1 — Views 54



Viewing all articles
Browse latest Browse all 4387

Trending Articles