Specifications

RIGOL
Programming Guide for DS1000B Series
3-6
Example 4 Reading the Data of Screen Image
#define BUFFER_IMAGE_SIZE 320*240+256*4+54+1;
void ImageUpload()
{
BYTE *bufImage = new BYTE[BUFFER_IMAGE_SIZE];
FILE *fp;
long headLen = 10;
long sizeImage = BUFFER_IMAGE_SIZE;
/*Judge the buffer validity*/
if (bufImage == NULL)
{
return;
}
/*Make a statement for the VISA status*/
ViStatus staDISP;
ViStatus sta488;
ViStatus staImage;
/*Make a statement for IEEE488.2 standard data header*/
BYTE head488[11] = {0};
/*Send the :DISP:DATA?\n command to read the data of screen
image*/
sta = viPrintf(g_vi,":DISP:DATA?\n");
sta488 = viRead(g_vi,head488,headLen,&headLen);
staImage = viRead(g_vi,bufImage,sizeImage,&sizeImage);
if (sta == VI_SUCCESS && sta488 == VI_SUCCESS && staImage ==
VI_SUCCESS)
{
fp = fopen("C:\\scope\\screen.bmp","wb");
if (fread(bufImage,sizeof(BYTE),BUFFER_IMAGE_SIZE,fp) !=
BUFFER_IMAGE_SIZE)
{