Whiteboard chat
-
Hello
I am new to Qt and am fairly new to programming (so apologies if I have a lack of understanding), I have a project I am doing but I am stuck and do not know how to go about it. The project is to have 2 windows open on a raspberry pi, one window ("send window") is to be drawn on (like a whiteboard) and the other window ("receive window") copies and displays the exact same drawing. My problem lies in that I need the communication between the windows to be physical (connect some of the pins together and whatnot) and so I assume the information must travel via UART. I have managed to code the "send window" to be a whiteboard, but I am stuck on how to transfer the drawing to the "receive window". I figured I could probably convert the "send window" image to a pixmap and then send that after converting it but that sounds like it would take forever and I do not want much lag between me drawing on the "send window" and the drawing being displayed (in real time) on the "receive window".
Any help would be appreciated and I thank you in advance :)
-
@kashry I don't think UART has enough bandwidth to send images, and even if it did, it is not optimal to do so. Instead of sending the image you should send the instructions, for example if a rectangle is drawn on the interface then send the position and dimension of the rectangle, and with that information you draw the rectangle on the other side
-
@eyllanesc thanks for getting back to me, the problem is that it isn't simple shapes being drawn on the interface, it is a drawing (like a smiley face) done by hand (or rather by mouse haha). But going with the idea of instructions, are there any instructions to colour a pixel on the "receive" interface as it is being coloured in on the "send" interface?
-
Hi,
Aren't you describing a mirroring mode ?
From your description you have the same stuff that must be shown on two different screens attached to the same device.
-
Does it update in real time? If it does then what events happen on one should be sent to the other. Like @eyllanesc said, those would be the "instructions" of what to draw.
-
This post is deleted!