This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TM4C129XNCZAD:同步文本的背景和前景颜色

Guru**** 2391665 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1022045/tm4c129xnczad-synchronize-of-background-and-foreground-color-of-text

器件型号:TM4C129XNCZAD
主题中讨论的其他器件:TM4C1294NCPDT

我在视频中附加的函数之一中使用 tm4c1294ncppdt 板和该 glib 示例

"两侧的文本"滑块函数我想创建不带滑块库的函数、我想在中更改图像、而不是此矩形、还需要更改图像上的数字打印和数字颜色、而不是背景颜色

e2e.ti.com/.../WhatsApp-Video-2021_2D00_07_2D00_27-at-10.50.41-AM.mp4

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

     grlib_demo 示例提供了多种创建滑块函数的方法。 下面显示的滑块结构对应于视频中的各种滑块。 对于大小、方向、前景颜色、背景颜色和文本、您应该能够将这些滑块自定义为适合您的应用的内容。

    //*****************************************************************************
    //
    // The eighth panel, which demonstrates the slider widget.
    //
    //*****************************************************************************
    Canvas(g_sSliderValueCanvas, g_psPanels + 7, 0, 0,
           &g_sKentec320x240x16_SSD2119, 210, 30, 60, 40,
           CANVAS_STYLE_TEXT | CANVAS_STYLE_TEXT_OPAQUE, ClrBlack, 0, ClrSilver,
           g_psFontCm24, "50%",
           0, 0);
    
    tSliderWidget g_psSliders[] =
    {
        SliderStruct(g_psPanels + 7, g_psSliders + 1, 0,
                     &g_sKentec320x240x16_SSD2119, 10, 105, 220, 30, 0, 100, 25,
                     (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_OUTLINE |
                      SL_STYLE_TEXT | SL_STYLE_BACKG_TEXT),
                     ClrGray, ClrBlack, ClrSilver, ClrWhite, ClrWhite,
                     g_psFontCm20, "25%", 0, 0, OnSliderChange),
        SliderStruct(g_psPanels + 7, g_psSliders + 2, 0,
                     &g_sKentec320x240x16_SSD2119, 10, 145, 220, 25, 0, 100, 25,
                     (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_OUTLINE |
                      SL_STYLE_TEXT),
                     ClrWhite, ClrBlueViolet, ClrSilver, ClrBlack, 0,
                     g_psFontCm18, "Foreground Text Only", 0, 0, OnSliderChange),
        SliderStruct(g_psPanels + 7, g_psSliders + 3, 0,
                     &g_sKentec320x240x16_SSD2119, 240, 70, 26, 110, 0, 100, 50,
                     (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_VERTICAL |
                      SL_STYLE_OUTLINE | SL_STYLE_LOCKED), ClrDarkGreen,
                      ClrDarkRed, ClrSilver, 0, 0, 0, 0, 0, 0, 0),
        SliderStruct(g_psPanels + 7, g_psSliders + 4, 0,
                     &g_sKentec320x240x16_SSD2119, 275, 30, 30, 150, 0, 100, 75,
                     (SL_STYLE_IMG | SL_STYLE_BACKG_IMG | SL_STYLE_VERTICAL |
                     SL_STYLE_OUTLINE), 0, ClrBlack, ClrSilver, 0, 0, 0,
                     0, g_pui8GettingHotter28x148, g_pui8GettingHotter28x148Mono,
                     OnSliderChange),
        SliderStruct(g_psPanels + 7, g_psSliders + 5, 0,
                     &g_sKentec320x240x16_SSD2119, 10, 30, 195, 37, 0, 100, 50,
                     SL_STYLE_IMG | SL_STYLE_BACKG_IMG, 0, 0, 0, 0, 0, 0,
                     0, g_pui8GreenSlider195x37, g_pui8RedSlider195x37,
                     OnSliderChange),
        SliderStruct(g_psPanels + 7, &g_sSliderValueCanvas, 0,
                     &g_sKentec320x240x16_SSD2119, 10, 70, 220, 25, 0, 100, 50,
                     (SL_STYLE_FILL | SL_STYLE_BACKG_FILL | SL_STYLE_TEXT |
                      SL_STYLE_BACKG_TEXT | SL_STYLE_TEXT_OPAQUE |
                      SL_STYLE_BACKG_TEXT_OPAQUE),
                     ClrBlue, ClrYellow, ClrSilver, ClrYellow, ClrBlue,
                     g_psFontCm18, "Text in both areas", 0, 0,
                     OnSliderChange),
    };