write text

How i can write text on display through coding in s7g2 board ?

  • Hi niku,

    You may use GUIX, add a prompt widget and set its contents using gx_prompt_text_set. This is the easiest way of displaying a text on the screen.

    Please find GUIX user's manual at SSP Website (X-Ware™ Component Documents for Renesas Synergy™).

    Regards,
    adboc

  • In reply to adboc:

    how i can write any text and single character through coding and without use any prompt?
  • In reply to niku:

    can you share sample code for as a reference purpose if you have ...?
  • In reply to niku:

    Hi niku,

    If you wouldn't like to use GUIX, you can draw pixel-by-pixel to the buffer and display it using the Display driver. Please take a look at GLCDC HAL Module Guide.

    Regards,
    adboc

  • In reply to adboc:

    I want to simple write "hello world" string by coding and display how i can do?
    i wont use any prompt,button etc..
    if you have this type basic code please give me...
  • In reply to niku:

    Hi niku,

    Even though you would like to draw a simple string like "Hello world", you should draw it pixel-by-pixel. Assuming you have a buffer[width*height], the application needs to fill required pixels in the buffer like buffer[x + width*y] = pixel_data.

    This might be quite time-consuming to write a code drawing even a simple text (pixel "map" for each character). I would rather go with GUIX and prompt with a custom font if needed.

    Regards,
    adboc
  • In reply to adboc:

    okay. thanks...!
    can you please give me this type of basic string code so i take a reference and implement in my project..!
  • In reply to niku:

    Hi niku,

    The following project draws "HELLO" on the screen (SK-S7G2, SSP 1.4.0).

    GLCDC_1.zip

    Hope it helps.

    Regards,
    adboc

  • In reply to adboc:

    In your code not showing and string in my display i am using custom board
    and one more thing is i am using gx_canvans_text_draw() function in my code but not showing in text on disply as comapre to if i use gx_canvas_pie or ellips() like this type function i use than it is show in my display..

    so what i can do?
  • In reply to niku:

    Hi niku,

    My understanding was you would like to draw a text without using GUIX, but now I understand this is not the case here. Have you called gx_context_font_set before gx_canvas_text_draw? Where gx_canvas_* functions are called, in a draw handler function? This is the recommended place for custom canvas drawing.

    Regards,
    adboc
  • In reply to adboc:

    okay.
    Tell me one thing.....
    if i want to write text or any character on display okay.
    so which guix function i can use gx_canvas, gx_propmpt,gx_pixel,or etc....???.
    These are all things i am confused which one i take... i can't understand ..

    And one more thing is i made one program grid line in that i was used gx_canvas _pixel_draw function and this program working is good and showing on display girdline.
    but now in that program i want to mention some text in particular position in my gridline line project so i put gx_canvas _text_draw() function oky. but it is not show any text on display..

    so these are the scenario Which I say to you i hope you understand my problem..
    please guide me what should i do?
  • In reply to niku:

    Hi niku,

    Have you set the font before using gx_context_font_set? I have implemented the following window drawing function and I see "Hello" text on the screen:

    VOID main_window_draw(GX_WINDOW *widget)
    {
       SSP_PARAMETER_NOT_USED(widget);
       gx_context_brush_define(GX_COLOR_ID_SELECTED_TEXT, GX_COLOR_ID_SELECTED_TEXT,
                               GX_BRUSH_ALIAS | GX_BRUSH_SOLID_FILL);
       gx_context_brush_width_set(1);

       gx_context_font_set(GX_FONT_ID_PROMPT);
       gx_canvas_text_draw(10, 10, "Hello", 5);
    }

    Regards,
    adboc

  • In reply to adboc:

    thanks adboc.. your code is working properly..

    and...
    i want to know one thing ...sir
    i want to touch that particular string and some particular box or some position...
    so please suggest me how i can implement touch functionality?
  • In reply to niku:

    Hi niku,

    The easiest way is to create a custom widget (gx_widget_create) and assign your drawing function (to draw a text) and event handler (to handle PEN_UP/PEN_DOWN) events. I suggest looking at GUIX user's guide (link "X-Ware™ Component Documents for Renesas Synergy™" at SSP website).

    Regards,
    adboc

  • In reply to adboc:

    can you share me this type of code if you have for reference purpose...?