Comments (13)
If I understand correctly, yes, that aspect is the same in version 9 compared to version 8.
https://docs.lvgl.io/master/overview/obj.html
Regarding lv_obj_set_style_transform_angle
, that should work since it's mapped using an API mapping for v8->v9, but lv_obj_set_style_transform_rotation
is the new function name.
from lvgl.
lv_img_set_angle and lv_obj_set_style_transform_angle not work.
from lvgl.
Do you get a compiler error or do they not work as intended at runtime?
from lvgl.
Compiles but does not work properly. More precisely, there is no image. At the same time, the stream in which lvgl loads the processor by 100%.
from lvgl.
Is it a binary image? See #6193. This is a known weakness of binary images.
https://docs.lvgl.io/master/widgets/image.html#transformations
The transformations require the whole image to be available. Therefore indexed images (
LV_COLOR_FORMAT_I1/2/4/8_...
), alpha only images cannot be transformed. In other words transformations work only on normal (A)RGB or A8 images stored as C array, or if a custom Image decoder returns the whole image.
from lvgl.
This is a png-decoded image in ARGB8888 format, which is located in the RAM array.
from lvgl.
Interesting. Could you please send some code to reproduce the issue?
from lvgl.
Load image:
void CreatePngImage(T_PNG_IMAGE *Img, const char *mem, uint16_t size, uint16_t w, uint16_t h)
{
Img->img = fbg_loadPNGFromMemory(mem, size);
Img->img->data[2] = 4;
uint32_t x, y, index = 0, color;
for (uint32_t i=0; i<((w*h)); i++)
{
color = Img->img->data[index]<<16;
color |= Img->img->data[index+1]<<8;
color |= Img->img->data[index+2];
if (color == 0xFF00FF)
{
Img->img->data[index] = 0;
Img->img->data[index+1] = 0;
Img->img->data[index+2] = 0;
Img->img->data[index+3] = 0;
}
index += 4;
}
uint32_t *img_buff32 = (uint32_t *)(Img->img)->data;
// swap color R<->B
unsigned char *img_buff = (unsigned char *)(Img->img)->data;
unsigned char tmp;
for (uint32_t i=0; i<((w*h)); i++)
{
tmp = *img_buff;
*img_buff = *(img_buff+2);
*(img_buff+2) = tmp;
img_buff += 4;
}
//
//Img->dsc.header.always_zero = 0;
Img->dsc.header.w = w;
Img->dsc.header.h = h;
Img->dsc.header.cf = LV_COLOR_FORMAT_ARGB8888; //LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED;
Img->dsc.data = (unsigned char *)(Img->img)->data;
Img->dsc.data_size = w * h * LV_COLOR_DEPTH / 8;
}
Image display:
lv_obj_t * imgArrow;
CreatePngImage(&IMG.Arrow, &_imageArrow, 392, 43, 44);
imgArrow= lv_img_create(osdDirHome.Panel);
lv_img_set_src(imgArrow, &IMG.Arrow.dsc);
lv_obj_set_size(imgArrow, 43, 44);
lv_obj_set_pos(imgArrow, 48/2-43/2, 48/2-44/2);
lv_img_set_angle(imgArrow, (180+osdDirHome.Angel*10)%360);
from lvgl.
lv_img_set_angle(imgArrow, (180+osdDirHome.Angel*10)%360);
The angle is in 0.1° unit, so it should be:
lv_img_set_angle(imgArrow, (1800+osdDirHome.Angel*10)%3600); //1800 and %3600
from lvgl.
lv_img_set_angle(imgArrow, (180+osdDirHome.Angel*10)%360);
The angle is in 0.1° unit, so it should be:
lv_img_set_angle(imgArrow, (1800+osdDirHome.Angel*10)%3600); //1800 and %3600
I agree. But that's not the problem.
from lvgl.
I can't seem to reproduce it. Does it work perfectly when you don't set the angle?
from lvgl.
If the angle is 0, then everything works, in other cases the program hangs.
from lvgl.
You mentioned the CPU goes to 100%. There's a chance an LV_ASSERT
failed and the default behavior is to spin forever (while(1);
). Do you have a way of getting a stacktrace or some other way of finding out where it's failing?
from lvgl.
Related Issues (20)
- Linux DRM display mode locks up by default due to missing lv_tick_set_cb HOT 1
- discussion about C++ code in LVGL HOT 6
- lv_api_map_v8.h has no consideration for things that are enabled/disabled
- Buggy Demos in 9.x HOT 3
- tiny_ttf ignores cache_size in lv_tiny_ttf_create_file_ex function HOT 1
- Play lottie example HOT 8
- More color depths HOT 3
- 9.1 Input Device Documentation HOT 6
- macOS buiold failure
- LVGL Integration strategy for Zephyr HOT 5
- Better sync between LVGL and Zephyr for runtime hw rotation HOT 2
- Animation and keyboard input conflict
- Setting system time under Linux affects ticks HOT 3
- screen refresh rate is very low HOT 5
- Problem with lv_demo_widgets demo(Instrument panel) after porting code to hardware HOT 1
- Button Matrix cannot be removed from lv_conf.h HOT 1
- Tiny TTF causes crash in certain situations HOT 1
- Tiny TTF should be caching stbtt_FindGlyphIndex HOT 26
- Line 11 of src/libs/tiny_ttf.c declared incorrectly HOT 1
- Docs build break HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.