Dear emWin community,
I have built a GUI using various widgets and windows offered by the emWin library. I am now trying to write a function to dump the screen contents from my LCD using memory devices so that I can stream it to my PC for virtual control. However, my memory devices only seem to capture the background. I can't seem to figure out why my memory devices are ignoring the widgets and windows. Am I missing a flag or making my calls to the library incorrectly?
My code:
void captureScreen(void) {
GUI_MEMDEV_Handle hMem;
U16 *pData; // pixels are 16 bits wide
int x=80, y=60, ratio1=GUI_xSize/x, ratio2=GUI_ySize/y, rectangles=ratio1 * ratio2, coord1, coord2;
for (int i=0; i coord1 = (i%ratio1)*x;
coord2 = (i/ratio2)*y;
hMem = GUI_MEMDEV_Create(coord1, coord2, x, y);
GUI_MEMDEV_Select(hMem);
GUI_MEMDEV_CopyFromLCD(hMem);
pData = (U16 *)GUI_MEMDEV_GetDataPtr(hMem);
// capture and transmit x*y 16-bit pixels here
GUI_MEMDEV_Delete(hMem);
}
GUI_MEMDEV_Select(0); // activates LCD, part of clean up
return;
}
Best regards,
Vincent
I have built a GUI using various widgets and windows offered by the emWin library. I am now trying to write a function to dump the screen contents from my LCD using memory devices so that I can stream it to my PC for virtual control. However, my memory devices only seem to capture the background. I can't seem to figure out why my memory devices are ignoring the widgets and windows. Am I missing a flag or making my calls to the library incorrectly?
My code:
void captureScreen(void) {
GUI_MEMDEV_Handle hMem;
U16 *pData; // pixels are 16 bits wide
int x=80, y=60, ratio1=GUI_xSize/x, ratio2=GUI_ySize/y, rectangles=ratio1 * ratio2, coord1, coord2;
for (int i=0; i coord1 = (i%ratio1)*x;
coord2 = (i/ratio2)*y;
hMem = GUI_MEMDEV_Create(coord1, coord2, x, y);
GUI_MEMDEV_Select(hMem);
GUI_MEMDEV_CopyFromLCD(hMem);
pData = (U16 *)GUI_MEMDEV_GetDataPtr(hMem);
// capture and transmit x*y 16-bit pixels here
GUI_MEMDEV_Delete(hMem);
}
GUI_MEMDEV_Select(0); // activates LCD, part of clean up
return;
}
Best regards,
Vincent