MINIGUI求指导

qq_43141430 2019-03-29 05:28:01
项目描述:数字楼宇对讲管理机,我用门口机呼叫管理机,管理机接听或者直接挂断后返回到主窗口,主窗口会有黑线,不能完美绘制。我在挂断点处用invalidaterect和updatewindow函数没有解决?求指导!
...全文
200 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xqhrs232 2019-04-09
  • 打赏
  • 举报
回复
怎么觉得是WINDOWS编程?
qq_43141430 2019-04-09
  • 打赏
  • 举报
回复
我接手的项目,在windows 端source insight里面写的
qq_43141430 2019-04-08
  • 打赏
  • 举报
回复
这是他们写的重绘函数,if语句在重绘时不执行,你帮我看看
qq_43141430 2019-04-08
  • 打赏
  • 举报
回复
case WM_PAINT:


mwforceNCpaint = TRUE;
printf("paint1\n");
/* repaint lower windows before alpha blending this window*/
++hwnd->unmapcount; /* tricky don't clip this window*/
SendMessage(rootwp, WM_PAINT, 0, 0);
for(sibwp=hwnd->siblings; sibwp; sibwp=sibwp->siblings)
SendMessage(sibwp, WM_PAINT, 0, 0);
--hwnd->unmapcount;
/* then queue repaint for higher windows*/
for(sibwp=hwnd->parent->children; sibwp != hwnd;
sibwp=sibwp->siblings)
/* don't paint if already painted by above code*/
if(sibwp->paintSerial != mwpaintSerial)
PostMessage(sibwp, WM_PAINT, 0, 0);
/* now paint this window offscreen and blend with screen*/

hdc=BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
/* redirect painting to offscreen dc*/
hdcMem = CreateCompatibleDC(ps.hdc);
hbmp = CreateCompatibleBitmap(hdcMem, rect.right, rect.bottom);
hbmpOrg = SelectObject(hdcMem, hbmp);
/* paint window to offscreen*/

hbr = (HBRUSH)GetClassLong(hwnd, GCL_HBRBACKGROUND);
FillRect(hdcMem, &rect, hbr);
//SelectObject(hdcMem, GetStockObject(DEFAULT_GUI_FONT));
SetBkMode(hdcMem, TRANSPARENT);



DEBUG("flag_connect is %d\n",flag_connect);
oldfont=SelectObject(hdc,font_chinese);
SetBkColor(hdc, RGB(100,149,237));

if(flag_connect == 0)
{


//hdc=BeginPaint(hwnd,&ps);
//GetClientRect(hwnd,&rect);







// SetTextColor(hdc, 0x004060a0);
//jimmy +++ set text color
// SetBkColor(hdc, RGB(255,00,00));

printf("paint2\n");


for(num_time=0;num_time<9;num_time++)
{
// fgets(buf_log,sizeof(buf_log),fp_log);
SetRect(&rect_log[num_time],20,150+32*num_time,20+200,150+20+32*num_time);
DrawText(hdc," ", -1, &rect_log[num_time], DT_WORDBREAK );

}


for(num_time=0;num_time<9;num_time++)
{

SetRect(&rect_right[num_time],540,150+32*num_time,540+80,150+20+32*num_time);
DrawText(hdc," ", -1, &rect_right[num_time], DT_WORDBREAK );

}

// DEBUG("tm.tmHeight is %d tm.tmAveCharWidth is %d\n",tm.tmHeight,tm.tmAveCharWidth);


//SetRect(&rect,20,150,20+200,150+ 20);

printf("paint3\n");

DrawText(hdc, "欢迎使用跃天楼宇对讲", -1, &rect_log[0],
DT_WORDBREAK );

cur_time(buf_showtime);
SetRect(&rect_top, 10,20+80,10+500,10+40);
DrawText(hdc,buf_showtime, -1, &rect_top, DT_WORDBREAK );

edit=CreateWindowEx(0L, "EDIT",
"",
WS_BORDER|WS_CHILD | WS_VISIBLE,//WS_VISIBLE,WS_DISABLED
10, 10, 500, 80,
hwnd, (HMENU)200, NULL, NULL);


//EndPaint(hwnd,&ps);

}
mydc=GetDC(hwnd);
DrawDIB(mydc, 570, 15, &image_logo);
ReleaseDC(hwnd,mydc);




DeleteObject(SelectObject(hdcMem, hbmpOrg));
DeleteDC(hdcMem);
//EndPaint(hwnd,&ps);//
printf("paint4\n");

break;
91program 2019-03-29
  • 打赏
  • 举报
回复
主窗口会有黑线,不能完美绘制。——这个要分析代码。
黑线是怎么来的,要分析一下。

19,502

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 嵌入开发(WinCE)
社区管理员
  • 嵌入开发(WinCE)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧