tonyc
February 18, 2021, 6:58pm
#1
I have an image loaded via a C array on the TFT.
I have added a test function (Click Event Callback) to attempt to rotate the image 10 degrees every time the image is clicked. However, when I execute the function the image appears not to rotate, but get cropped to a thin vertical line.
Here is the code snippet I am using:
static void img1_event_cb(lv_obj_t * obj, lv_event_t event)
{
lv_img_set_angle(img1,100);
}
Thanks…
tarvik
February 18, 2021, 7:12pm
#2
I’ve been away from using this library for a while, so I’m definitely rusty but I’ll give it a shot.
Have you set a pivot point in the middle of the image? See here .
tonyc
February 18, 2021, 7:15pm
#3
Well, the documentation says the default is the center of the image, as one would expect.
I guess I could try to set it manually…
tonyc
February 18, 2021, 7:22pm
#4
Setting the pivot point manually gives the same result.
So there must be something else not right…
Any suggestions?
tonyc
February 18, 2021, 9:01pm
#5
I got it working… I had to re convert the image C array to TrueColor. I had it initially set to 256 color because my image is mostly B&W.