Displaying Bitmaps with STemWIN

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

  • Displaying Bitmaps with STemWIN


    Im having a problem getting bitmaps to draw with the following functions:


    drawing with any of these functions I see either the top-left most
    pixel or a vertical row of image pixels displayed at the image location I

    However I can display the bitmap fine by using either:


    know I could just use the scaled versions with a scaling factor of 1.
    But when drawing image "widgets" inside a window, it seems you need to
    use IMAGE_SetBMP(), which is what I'm trying to do.

    Has anyone else experienced the same problem as this or can tell me what I am doing wrong?

    Im using the STM3210C-EVAL board and stemwin version 1.1.2.

  • Hey there,

    Yeah sure thing - for those functions I made sure to use the output from the windows tool that generates code from the bitmap.

    It seems that functions that offer scaling are the only ones that work for me i.e. GUI_DrawBitmapMag() GUI_BMP_DrawScaled() (regardless of emWin bitmap data structure or windows BMP).
    The function I would really like to get working is IMAGE_SetBMP() which draws into a widget.

  • Hello Craig,

    The behavior you describe really makes me wonder. Let's isolate the problem.

    Do you have a valid handle to the IMAGE widget?
    Is the widget set to be visible (WM_CF_SHOW)?
    Is it created within a dialog (possibly using the GUIBuilder)?
    Is it placed on a visible part of the screen (within the borders of a parent window)?
    Does the pointer you pass as 2nd parameter (pData) point to valid BMP data?
    Do you pass the correct size of the BMP data in the 3rd parameter?

    Best regards,