Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has any low level interface in this LIB? #54

Closed
charles-lyc opened this issue Dec 26, 2017 · 23 comments
Closed

Has any low level interface in this LIB? #54

charles-lyc opened this issue Dec 26, 2017 · 23 comments

Comments

@charles-lyc
Copy link

LittlevGL is nice.
I figured it using some object drawing interface, but when I wana just draw a simple line or rectangle or just for testing the hardware, the Lib just stop in lv_refr_areas(), seems like I should enbale the area firstly?

@kisvegabor
Copy link
Member

Hi!

Maybe you know that there are two drawing methods: buffered and unbuffered. Learn more here: http://www.gl.littlev.hu/basics#drawing-and-rendering

In buffered mode (LV_VDB_SIZE > 0) you can't draw to the display directly because the buffering is controlled by the library.

In unbuffered mode (LV_VDB_SIZE == 0) you can draw to the display directly but your drawing might be "overdrawn" when a refresh occurs.

I recommend rather to create and lv_line object to draw a line, or an lv_obj to create a simple rectangle.

In general lvgl not thinking in drawing (from the user side) but thinking in graphical objects. This way the library will know the graphical objects and can draw them correctly.

@charles-lyc
Copy link
Author

That means I can create anything I want after create a object? (Such as an oscilloscope or a multi-meter.)

@kisvegabor
Copy link
Member

For an oscilloscope you can create a line object or a chart and set the point's values. See http://www.gl.littlev.hu/object-types

@charles-lyc
Copy link
Author

Yep, I know that.
But if I want to redesign my oscilloscope, (will be more complex) , how?

@kisvegabor
Copy link
Member

If you mean you would like to add e.g. Volt/div or trigger mode just create drop down lists for them or for AC/DC coupling create button.

@charles-lyc
Copy link
Author

Well, I mean there are lot of point and line, that I have to draw directly into the background, and the style just diff from LVGL, how about that?

@kisvegabor
Copy link
Member

kisvegabor commented Dec 26, 2017

I just don't understand why would you like to draw directly to the background. Please tell a little bit more details about your goals.

What kind of style do you need? Please tell it too.

@charles-lyc
Copy link
Author

Well, for an example, I saw an Agilent Oscilloscope, I want to design like that. There are some dash line to mark or measuring, some curve to display the FFT effect, such like those.

@kisvegabor
Copy link
Member

Well, actually dash line is not supported now but maybe it will in a next release. Or check http://gl.littlev.hu/services to request a new feature or use thin line instead.
But for FFT a chart can be used very well. And the whole GUI of an Agilent oscilloscope can be built from objects. It's much simpler then just drawing. E.g. just create a chart or button and the library will draw or redraw it when it is required. You just need to set the chart's data or a button's click action (a function to call when clicked).

@charles-lyc
Copy link
Author

Ok. That will be more efficient. : P
But what if I, whatsoever, want to have my own design object, (I just found "lv_objx_templ.c") Is that right to modify it?

@kisvegabor
Copy link
Member

Then you have two options:

  1. Use lv_objx_templ but copy it like lv_myobj
  2. Set a new design function for an object: lv_obj_set_design_func(line1, my_func)

Are you familiar with styles? You can modify the appearances with them.

@kisvegabor
Copy link
Member

Sorry, closed by mistake :)

@charles-lyc
Copy link
Author

Fine.
Well, that will be more expansible.

@kisvegabor
Copy link
Member

How do you mean?

I forget to say that I recommend the using of styles because they are created for users. The new object type and design function are more complicated and kind of hacks

@charles-lyc
Copy link
Author

Yes, I know that will be better. I will prior use the objects existing.

BTW, what does "LV_MISC" means?

@kisvegabor
Copy link
Member

Lv_misc contains not graphics but general stuffs like memory management, task handling etc.

@charles-lyc
Copy link
Author

It seems like a little bit heavy? I just undefined most of objects, anti-aliasing, shadow, but still cost a lot of time to compile and download the firmware.
Do you have any idea?

@charles-lyc
Copy link
Author

The flash size I will check latter, not small.

@charles-lyc
Copy link
Author

For about 130K extra more with LVGL...

@kisvegabor
Copy link
Member

Have you disabled the unused fonts?

@charles-lyc
Copy link
Author

I dis the used 40 Fonts, works, thanks.
BTW, it support UTF-8 encode, so does it mean I can display any language I want on the earth?

@kisvegabor
Copy link
Member

Basically yes. There are some "tricky" languages like Arabic or Thai which needs some things but e.g Chinease, Korean, Greek, Cyrillic etc is fully supported.

Read this to learn how the fonts work:
http://www.gl.littlev.hu/basics#fonts

And this to see how ta add a new font:
http://www.gl.littlev.hu/font-converter

@kisvegabor
Copy link
Member

As a lot of question is answered here and we are far from the original question I close this issue.

mask131 pushed a commit to mask131/lvgl that referenced this issue Jan 25, 2021
Add minor change to notice on xhost command
kisvegabor pushed a commit that referenced this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants