鄙人当前的项目使用一块单色屏,并移植了emwin,现在需要调用emwin的graph控件做折线图,可是创建控件,并绑定了数据结构,仍不见有折线图显示;恳请哪位有相关经验的大神指点一二;在单色屏上使用emwin的graph控件;以下是试探性的代码,按键可以正常显示
pGraph5min = GRAPH_CreateEx(30, 239, 260, 208, WM_HBKWIN, WM_CF_SHOW | WM_CF_CONST_OUTLINE, 0, 0);
// GRAPH_SetUserDraw(GRAPH_Handle hObj, void(* pOwnerDraw)(WM_HWIN, int));
GRAPH_SetBorder(pGraph5min, 30, 10, 20, 15);
// WM_SetHasTrans(pGraph5min);
WIDGET_SetEffect(pGraph5min, &WIDGET_Effect_None);
// GRAPH_SetColor(pGraph5min, GUI_WHITE, GRAPH_CI_BK);
// GRAPH_SetColor(pGraph5min, GUI_WHITE, GRAPH_CI_BORDER);
// GRAPH_SetColor(pGraph5min, GUI_WHITE, GRAPH_CI_FRAME);
// GRAPH_SetColor(pGraph5min, GUI_WHITE, GRAPH_CI_GRID);
//GRAPH_SetGridVis(pGraph5min, 1);
//GRAPH_SetLineStyleH(pGraph5min, GUI_LS_DOT);
//GRAPH_SetLineStyleV(pGraph5min, GUI_LS_DOT);
GRAPH_SetGridDistX(pGraph5min, 25);
GRAPH_SetGridDistY(pGraph5min, 25);
GRAPH_SetGridFixedX(pGraph5min, 1);
pGraph5minDat = GRAPH_DATA_YT_Create(GUI_BLACK, 150, 0, 0);
GRAPH_AttachData(pGraph5min, pGraph5minDat);
GRAPH_DATA_YT_SetOffY(pGraph5minDat, 20);
GRAPH_DATA_YT_SetAlign(pGraph5minDat, GRAPH_ALIGN_LEFT);
GRAPH_DATA_YT_Clear(pGraph5minDat);
int i = 0;
for(; i<150; i++)
{
GRAPH_DATA_YT_AddValue(pGraph5minDat, i);
}
hbutton = BUTTON_CreateEx(300,50,60,40,WM_HBKWIN, WM_CF_SHOW | WM_CF_CONST_OUTLINE, 0, 0);
BUTTON_SetFont(hbutton, GUI_FONT_20_1);
BUTTON_SetText(hbutton, "BTN");
2018-12-19 09:19:49
本帖最后由 wenyangzeng 于 2018-4-13 10:05 编辑
单色屏移植emwin,需要找到emwin相关LCD驱动。在LCDConf_FlexColor_Template.c中修改相应LCD配置:
例:某型号TFT-lcd驱动:
GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI,
GUIDRV_FLEXCOLOR_F66702, GUIDRV_FLEXCOLOR_M16C0B16);
本帖最后由 wenyangzeng 于 2018-4-13 10:05 编辑
单色屏移植emwin,需要找到emwin相关LCD驱动。在LCDConf_FlexColor_Template.c中修改相应LCD配置:
例:某型号TFT-lcd驱动:
GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66702, GUIDRV_FLEXCOLOR_M16C0B16);
举报
2018-12-19 09:30:27
屏幕是小日本的menmory lcd,驱动已经起来了,不是用的官方的驱动,现在字符串,按钮,画线都可以正常显示,graph就不行
屏幕是小日本的menmory lcd,驱动已经起来了,不是用的官方的驱动,现在字符串,按钮,画线都可以正常显示,graph就不行
举报
2018-12-19 09:52:55
feixiang20 兄的建议确实是方向,十多年前我也 Porting 过至单色屏,也是改改这 uC-GUI | emWin 所配置的参数就行了,估计应很好使的。
feixiang20 兄的建议确实是方向,十多年前我也 Porting 过至单色屏,也是改改这 uC-GUI | emWin 所配置的参数就行了,估计应很好使的。
举报