This VI demonstrates how the user can programmatically fill their ROI with a rectangular overlay. This VI requires Vision Acquisition Software. The image buffer created is 400x400 pixels, and is then filled with a pixel value of 100. This is just to see a gray background. Then, using an event structure, the ROI cooridnates are transformed into a rectangular overlay with the bundle function. The boolean "fill?" determines whether or not to fill the ROI.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
To fill a rectangular ROI is easy, but how to fill a polygon or closed freehand ROI? Any suggestions?
Best regards. Piet