/********************************************************************************/ /* * File name: MDigGrab.c * * Synopsis: This program demonstrates how to grab from a camera in * continuous and monoshot mode. */ #include #include void main(void) { MIL_ID MilApplication, /* Application identifier. */ MilSystem, /* System identifier. */ MilDisplay, /* Display identifier. */ MilDigitizer, /* Digitizer identifier. */ MilImage; /* Image buffer identifier. */ /* Allocate defaults. */ MappAllocDefault(M_SETUP, &MilApplication, &MilSystem, &MilDisplay, &MilDigitizer, &MilImage); /* Grab continuously. */ MdigGrabContinuous(MilDigitizer, MilImage); /* When a key is pressed, halt. */ printf("\nDIGITIZER ACQUISITION:\n"); printf("----------------------\n\n"); printf("Continuous image grab in progress.\n"); printf("Press to stop.\n\n"); getch(); /* Stop continuous grab. */ MdigHalt(MilDigitizer); /* Pause to show the result. */ printf("Continuous grab stopped.\n\n"); printf("Press to do a single image grab.\n\n"); getch(); /* Monoshot grab. */ MdigGrab(MilDigitizer, MilImage); /* Pause to show the result. */ printf("Displaying the grabbed image.\n"); printf("Press to end.\n\n"); getch(); /* Free defaults. */ MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImage); }