HC_Show_Snapshot
-
bool
HC_Show_Snapshot(char const *display, int *width, int *height, void *image_data) - bool HC_Show_Snapshot(char const display, int width, int height, void image_data)
Takes a snapshot of the scene.
Call Show_Snapshot with image_data set to nullptr to know the size of the data necessary to hold the image. Since image_data is returned * in RGB format, the size needed for holding the image is width * height * 3. Example:
int width, height; if (HC_Show_Snapshot("?Picture", &width, &height, nullptr)) { unsigned char * image_data = new unsigned char[width * height * 3]; if (HC_Show_Snapshot("?Picture", &width, &height, image_data)) { //Do something with image_data } delete[] image_data; }
Parameters
display: - Commonly “?Picture”. In general, a segment with an attached device driver.
width: - The number of columns in data, returned to caller.
height: - The number of rows in data, returned to caller.
image_data: - The pixel values making up the snapshot, in RGB format. Returned to caller.
Returns
true if the operation completed successfully, otherwise false.