cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin GUI_CopyRect is not working in STM32F746G-Discovery

sv1eia
Associate II
Posted on October 28, 2015 at 14:07 Hi, Used the STemWin with quite a few demos on STM32F746G-Discovery so far succesfully, yet it seems that the GUI_CopyRect is not working. Tested it with many code variations but no rectangle nomatter small or large, overlapping or not, could be copied. This code supposedly copies the ''Hello world!'' phrase on STemWin hello world example application but it is not doing anything at all..

void MainTask(void) {
int i,j;
GUI_Clear();
GUI_SetFont(&GUI_Font20_1);
GUI_DispStringAt(''Hello world!'', (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);
// GUI_CopyRect here should copy the phrase 50 pixels below, yet it does nothing
GUI_CopyRect((LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2,
(LCD_GetXSize()-100)/2, 50 + (LCD_GetYSize()-20)/2, 100, 20);
while(1);
}

Can someone tell me please how can we make the GUI_CopyRect work properly? Regards,
4 REPLIES 4
Posted on October 29, 2015 at 17:46

Hinikolaou.christos,

In LCD configuration file (LCDConf.c) please change “CUSTOM_CopyRect�? API by the following one:

/**
* @brief Copy rectangle
* @param LayerIndex : Layer Index
* @param x0: X0 position
* @param y0: Y0 position
* @param x1: X1 position
* @param y1: Y1 position
* @param xSize: X size. 
* @param ySize: Y size. 
* @retval None.
*/
static void CUSTOM_CopyRect(int LayerIndex, int x0, int y0, int x1, int y1, int xSize, int ySize) 
{
U32 AddrSrc, AddrDst;
AddrSrc = layer_prop[LayerIndex].address + (y0 * layer_prop[LayerIndex].xSize + x0) * layer_prop[LayerIndex].BytesPerPixel;
AddrDst = layer_prop[LayerIndex].address + (y1 * layer_prop[LayerIndex].xSize + x1) * layer_prop[LayerIndex].BytesPerPixel;
DMA2D_CopyBuffer(LayerIndex, (void *)AddrSrc, (void *)AddrDst, xSize, ySize, layer_prop[LayerIndex].xSize - xSize, layer_prop[LayerIndex].xSize - xSize);
}

Thank you for your feedback, -Shahrzad-
sv1eia
Associate II
Posted on October 29, 2015 at 18:29

Dear Shahrzad,

Thank you for the swift answer.

Did replace the old custom function with the new one and it does work properly.

If there is any update on the other remaining 3 custom functions please let me know so (FillRect, CopyBuffer,DrawBitmap32bpp) as it seems that they might have the same issues although have not tested them yet.

Thank you again.

Christos

Posted on November 02, 2015 at 16:38

Hi nikolaou.christos,

Other functions (FillRect, CopyBuffer,DrawBitmap32bpp) are correct. You can use them.

-Shahrzad-

sv1eia
Associate II
Posted on November 02, 2015 at 16:58

Ok Shahrzad,

Thank you for the update

Christos