Problem in use MEMDEV in Callback Function

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Problem in use MEMDEV in Callback Function

    hi,

    i need to draw a big picture on LCD, So first loaded picture from NAND flash to a buffer on SDRAM, then with MEMDEV Functions, Draw it on LCD,

    but, when i tried to repeat those work in the Call back Function for a DialogeBox, it does'nt work Correctly. befor executed this function :"GUI_MEMDEV_CopyToLCD ( hMem0 );", picture displayed By And By.

    my code is :


    case WM_INIT_DIALOG:
    // Initialization of 'Window'


    //Load_Photo_To_Buffer ( "Test_JPEG_large.h" );

    hItem = WM_GetDialogItem ( pMsg->hWin, ID_IMAGE_0 );

    pData = _GetImageById_1 ( ID_IMAGE_0_IMAGE_0, &FileSize );

    GUI_MEMDEV_Select ( hItem );
    GUI_JPEG_Draw ( buff , file_size , 0, 0);
    GUI_MEMDEV_CopyToLCD ( hItem );

    ?(
    ?(
    ?(
    ?(

    The post was edited 1 time, last by mahdiafpr ().

  • Hi, :)


    I have a question,
    8)



    when we use "GUI_CreateDialogBox " or "WM_CreateWindowAsChild ", we should draw background in the "call back" routin. i think that we have "ONLY" one command to draw bmp picture : "IMAGE_SetBMP( hItem, pData, FileSize );".


    so, if i need to draw a big size bitmap picture, what can i do?


    i know that with "IMAGE_CF_MEMDEV" flag, in dialogebox
    Creation Step
    , memdev help us. but for big picture a long time passed to show picture!!! what can i do?

    how can i load pic in a buffer, such as multibuffer functions, that it can use in call back routin?
    ?(
    ?(
    ?(

    The post was edited 1 time, last by mahdiafpr ().

  • Hello,

    In case Memory Devices are enabled for the IMAGE widget the first time the widget is drawn should take the time according to the type and size of the actual image. Once this happened Memory Devices help speed up the displaying process significantly. Please note that displaying the IMAGE widget will always take the same amount of time in case the Memory Device could not be created. The only reason for a Memory Devi ce not to be created is lack of memory. Please check your GUIConf.c in this case.

    Best regards,
    Adrian
  • Hello,

    Since this is hardware related, I would recommend shrinking the size of the image if possible. The Bitmap Converter can be used for example to store an image using RLE compression. In order to improve performance the bitmap should be stored using the color conversion which matches the screen colors.

    Best regards,
    Adrian