Description
I am trying to rescale the size of simulator screen in Code blocks from 480x320 px to 320x240 px
What MCU/Processor/Board and compiler are you using?
I am using latest Code block windows simulator
What do you want to achieve?
I have already fully designed a project using 480x320 px screen size on the Codeblocks simulator. However, my client wanted it to be in 320x240 px screen size.
What have you tried so far?
I’ve tried to change the LV_HOR_RES and LV_VER_RES in lv_conf.h but to no luck. I’ve also tried to change the resolution in lv_drv_conf.h but still displayed the default size. I’ve cleaned the workspace and rebuild the project, but it still shows 480x320 screen size.
Code to reproduce
void lv_demo_try(void)
{
static lv_style_t style;
lv_style_init(&style);
/*Set a background color and a radius*/
lv_style_set_bg_color(&style, LV_STATE_DEFAULT, LV_OFFICIAL_COLOR);
lv_style_set_border_width(&style, LV_STATE_DEFAULT, 0);
lv_obj_t * win = lv_win_create(lv_scr_act(), NULL);
lv_obj_set_size(win, 480, 500);
lv_obj_align(win, NULL, LV_ALIGN_CENTER, 0,-50);
lv_obj_add_style(win, LV_STATE_DEFAULT, &style);
lv_obj_t * img = lv_img_create(lv_scr_act(), NULL);
lv_img_set_src(img, &official_logo);
lv_obj_align(img, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_t * label;
lv_obj_t * obj1 = lv_obj_create(lv_disp_get_scr_act(NULL), NULL);
lv_obj_align(obj1, NULL, LV_ALIGN_IN_BOTTOM_MID, 10 ,0);
lv_obj_add_style(obj1, LV_STATE_DEFAULT, &style);
label = lv_label_create(obj1, NULL);
lv_label_set_recolor(label, true);
lv_label_set_text(label, "#ffffff CLICK HERE#");
lv_obj_set_event_cb(obj1, login_page);
}