12-20-2025, 04:04 PM
(12-15-2025, 09:27 PM)bobalooie Wrote: Hi,Hi @bobalooie
I have a question about using the HelperCanvas property of picture boxes: I am working on a program for simulating a signalized intersection. There are a couple of picture boxes to depict signals. To test the displays, I am doing this in the BeforeUpdateDisplay sub:
IF Control(SignalDesignFR).Hidden = False THEN
olddisplay = _SOURCE
_DEST sigdisplay
_PUTIMAGE (50, 50), Sections(0)
_PUTIMAGE (50, 114), Sections(5)
_PUTIMAGE (50, 178), Sections(10)
Control(SignalsPB).HelperCanvas = sigdisplay
_DEST intdisplay
_PUTIMAGE (50, 50), Sections(0)
_PUTIMAGE (50, 114), Sections(5)
_PUTIMAGE (50, 178), Sections(10)
Control(TrafficPB).HelperCanvas = intdisplay
_DEST olddisplay
END IF
The two images sigdisplay and intdisplay are created with _NEWIMAGE and match the dimensions of the picture boxes SignalsPB and TrafficPB respectively. The Sections() array contains handles to 64x64 pixel images of individual signal sections (red, amber, green) from _EMBED/_EMBEDDED image files (per the online tutorial page "Icons, Images and Title".)
The results I get are as shown. The left endpoints of the lines appear to be correctly located for the insertion points specified by the _PUTIMAGE calls; the lines run to the right edges of the picture boxes.
Am I missing something?
I've not understood from your image posted here the issue, but your description is almost clear.
So I have built an Informpe demo with the essential items to duplicate the issue or to solve it.
I made a form with 2 pictureboxes of height 70 and width 280 , a button for switching between drawing and clearing the surfaces of the 2 pictureboxes using Informpe. Saving and passing to QB64pe IDE 4.2.0 I have added 2 _newimages of the same dimensions of the 2 pictureboxes and 11 _newimages 64x64 pixels to draw on the pictureboxes via the 2 bigger _newimages.
After a normal compiling, on running I got a console output of errors that leads me to an unsolved output in the running application.
Maybe that this result is for the OS where I made the attempt: Kubuntu 24.04 and the same code has no error in Windows.
Now I cannot use a Windows pc to test this code.
Please try it on a Windows pc if you can.
_putimage_Picturebox.bas (Size: 5.55 KB / Downloads: 17)
_putimage_Picturebox.txt (Size: 2.5 KB / Downloads: 21)
_putimage_Picturebox.txt must be renamed changing the extension into .frm because the website has denied to load the .frm file.
Please gimme a feedback.


![[Image: Screenshot-2025-12-15-154101.png]](https://i.ibb.co/FLvn502c/Screenshot-2025-12-15-154101.png)