MULTIPAGE with bitmap and BorderSize=0 -> strange result

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

  • MULTIPAGE with bitmap and BorderSize=0 -> strange result

    Hi,

    I want to build a MULTIGAPE with a bitmap for each tab instead of text. In general it works.
    But I want to finetune the design with a the bitmap which fills the complete tab (heigth and width). No tab background should be visible (except the Frame).

    But I was not able to eleminate the background. Further emWin produces a strange result.

    What did I do? I started with:

    MULTIPAGE_SetBitmap(hMultiPage, &bmIcon2, 0, MULTIPAGE_BI_SELECTED);
    MULTIPAGE_SetBitmap(hMultiPage, &bmIcon2, 0, MULTIPAGE_BI_UNSELECTED);


    To prevent any border between bitmap and frame I try (of corse before MULTIPAGE_Create):

    MULTIPAGE_SetDefaultBorderSizeX(0);
    MULTIPAGE_SetDefaultBorderSizeY(0);


    The result is a little bit strange.
    I put two pictures with the result:

    Left picture: First tab SELECTED - Right picture: First tab UNSELECTED (enabled)

    [img]http://mcklose.noip.me:3223/upload/testgross2a.png[/img] [img]http://mcklose.noip.me:3223/upload/testgross2b.png[/img]

    I choose extrem colors with SetSkinFlexProps for the different multipage
    elements (foreground, background, frame etc.)
    to distinguish between them and find out what emWin is doing exactly (unfortunately it isnt documentated).

    • blue: The Bitmap (42 x 26 pixel)
    • lightred: Frame of selected pagelightgreen: Background of selected page
    • darkred: Frame of unselected page (enabled) (without bitmap for test)
    • grey: Background of unselected page (enabled) (without bitmap for test)

    Question:

    What have I to do to eleminate the border (already set to 0!) between the bitmap and the frame,
    while keeping the frames (selected and unselected) visible proper?

    Strange:
    • In selected state (left picture) the sourounding frame (lightred) is interrupted by the bitmap.
    • In unselected state the frame of the selected neighbour tab is interrupted on the bottom of the bitmap (at the first unselected tab)
    Is that a bug?
    Or what I am doing wrong?

    I'm looking forward to your answer.

    Matz

  • Hi Matz,

    The problem is that per default skinning is enabled. The default skinning always draws a frame around the tabs. With default skinning I would recommend use bitmaps with transparency.
    You can turn off the skinning if you add the following into GUI_Conf.h:
    #define WIDGET_USE_FLEX_SKIN 1

    Unfortunately you need to rebuild emWin after adding the define to GUIConf.h. So this won't work when using any precompiled libraries (e.g. STemWin or a trial lib from our website).

    Fortunately it is possible to set your own skinning routine. This allows you to react on paint events send for the different parts of a widget (here the MULTIPAGE).
    Just have a look into the sample application attached. The interesting part starts at line 225, the rest are just bitmap data.

    Regards,
    Sven
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.