2
« on: May 07, 2019, 02:34:15 pm »
Thank you for fast reply.
void APP_LoadImagePNG(void)
{
uint16_t Reg_Cmd_Write_Offset = 0;
uint16_t ParameterAddr = 0;
uint32_t End_Address = 0;
uint32_t Width = 0;
uint32_t Height = 0;
uint32_t StartAddress = 0;
API_LIB_BeginCoProList(); // Begin new co-processor list
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
API_CMD_LOADIMAGE(StartAddress,0); // Load image command. Extract data to RAM_G + 0, options = 0
API_LIB_EndCoProList(); // Finish the co-processor list
API_LIB_WriteDataToCMD(EVE_PNG, sizeof(EVE_PNG)); // Send data immediately after the command (since we don't select MEDIAFIFO as source in Options))
API_LIB_AwaitCoProEmpty(); // Await completion of the Load Image. Image will now be in RAM_G
// ###### Check parameters of decompressed image ########
API_LIB_BeginCoProList(); // Begin co-pro list
API_CMD_GETPROPS(0, 0, 0); // GetProps command with three dummy 32-bit values
API_LIB_EndCoProList(); // Finish the co-processor list
API_LIB_AwaitCoProEmpty(); // Await the command completion
Reg_Cmd_Write_Offset = EVE_MemRead16(REG_CMD_WRITE); // Check current pointer value
ParameterAddr = ((Reg_Cmd_Write_Offset - 12) & 4095); // Go back by 12 bytes to get end address parameter
End_Address = EVE_MemRead32((RAM_CMD+ParameterAddr));
ParameterAddr = ((Reg_Cmd_Write_Offset - 8) & 4095); // Go back by 8 bytes to get width parameter
Width = EVE_MemRead32((RAM_CMD+ParameterAddr));
ParameterAddr = ((Reg_Cmd_Write_Offset - 4) & 4095); // Go back by 4 bytes to get height parameter
Height = EVE_MemRead32((RAM_CMD+ParameterAddr));
// ######################################################
API_LIB_BeginCoProList(); // Begin new screen
API_CMD_DLSTART(); // Tell co-processor to create new Display List
API_CLEAR_COLOR_RGB(50, 70, 200); // Specify color to clear screen to
API_CLEAR(1,1,1); // Clear color, stencil, and tag buffer
API_COLOR_RGB(255,255,255); // White colour will display image with original colours
[b][color=red]API_CMD_GRADIENT(0, 0, 0xF11F11, 0, 160, 0x0101FF); [/color][/b]
API_BITMAP_HANDLE(0); // Tell FT81x the properties of the bitmap we will display.
API_BITMAP_SOURCE(StartAddress);
API_BITMAP_LAYOUT(RGB565, Width*2, Height); // FMT, STR, H
API_BITMAP_SIZE(BILINEAR, BORDER, BORDER, Width, Height); // W, H
API_BITMAP_LAYOUT_H((Width * 2) >> 10, Height >> 9);
API_BITMAP_SIZE_H(Width >> 9, Width >> 9);
API_BEGIN(BITMAPS);
API_VERTEX2II(85,205,0,0); // Display image at (200,200)
[b][color=red]API_CMD_BUTTON(20,20,60,20,14,0,"Page 1");[/color][/b]
API_END();
API_DISPLAY(); // Tell EVE that this is end of list
API_CMD_SWAP(); // Swap buffers in EVE to make this list active
API_LIB_EndCoProList(); // Finish the co-processor list burst write
API_LIB_AwaitCoProEmpty();
//////////////////////////////////////////////////////////////////////////////////////////////
}
Only stuff in bold added.
I've just noticed, bold and colours don't work in code quote..sorry about that.