2
0
2
2
-0
2
44
Configuration
4. Output of Area Image Data
Wait for the first container. The time for this can be limited to 500 ms, as in this case. This time-
out period can be set depending on the data to be received. A check is then made as to
whether the container exists and whether it contains an image. If it contains an image, it is
saved to the BMP variable and the image is stored in png format in the Temp directory.
// try to get a data container within 500 ms
var dataItem =await_vsxProtocolDriver.GetDynamicContainer(500);
// Check if dataItem.Container now exists
if (dataItem.Succ && (dataItem.Container !=null))
{
// Check if there is an Image message contained
if (dataItem.Container.ContainsMessage("Image"))
{
var Img = dataItem.Container.GetMessage("Image") as VsxIm-
ageDataRegionMessage;
var Bmp = Img.Image;
Bmp.Save("C:/Temp/Bild.png");
}
}