/* Copy texture to be displayed on LCD from Flash to SDRAM */ CopyPicture((uint32_t *)&image_320x240_argb8888, (uint32_t )LCD_FRAME_BUFFER, 240, 100, 320, 240); / Prepare area to display frame number in the image displayed on LCD */ UTIL_LCD_SetTextColor(UTIL_LCD_COLOR_BLUE); UTIL_LCD_FillRect(0, 400, LCD_X_Size, 80, UTIL_LCD_COLOR_BLUE); UTIL_LCD_SetTextColor(UTIL_LCD_COLOR_WHITE); UTIL_LCD_SetBackColor(UTIL_LCD_COLOR_BLUE); UTIL_LCD_SetFont(&Font16);
时间: 2023-08-15 18:07:38 浏览: 148
015_render_to_texture.zip_linux opengl_opengl texture_render to
这段代码的问题在于第二个参数传递给了一个指针变量的值,而不是指针变量本身。应该将第二个参数的类型改为指针类型,并传递指针变量的地址,即将 `(uint32_t )LCD_FRAME_BUFFER` 改为 `(uint32_t *)LCD_FRAME_BUFFER`。
修改后的代码如下所示:
```
/* Copy texture to be displayed on LCD from Flash to SDRAM */
CopyPicture((uint32_t *)&image_320x240_argb8888, (uint32_t *)LCD_FRAME_BUFFER, 240, 100, 320, 240);
/* Prepare area to display frame number in the image displayed on LCD */
UTIL_LCD_SetTextColor(UTIL_LCD_COLOR_BLUE);
UTIL_LCD_FillRect(0, 400, LCD_X_Size, 80, UTIL_LCD_COLOR_BLUE);
UTIL_LCD_SetTextColor(UTIL_LCD_COLOR_WHITE);
UTIL_LCD_SetBackColor(UTIL_LCD_COLOR_BLUE);
UTIL_LCD_SetFont(&Font16);
```
这样修改后,第二个参数将会被正确地解释为一个指针类型,而不是一个无效的整数值,从而修复了代码中的错误。
阅读全文