-
Notifications
You must be signed in to change notification settings - Fork 4
PictureBox Drawing
Samuel Gomes edited this page Feb 12, 2024
·
2 revisions
You can use a PictureBox control as a drawing canvas and use all QB64 drawing commands. To do so, use the methods BeginDraw and EndDraw:
BeginDraw PictureBox1 'Replace PictureBox1 with the actual ID of the desired PictureBox
'Drawing code goes here
EndDraw PictureBox1
A good place to add code that updates a PictureBox's software drawing is the BeforeUpdateDisplay event handler (SUB __UI_BeforeUpdateDisplay), as it is run before every form repaint.
Code showcasing the technique: