博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
用Win32实现类似MFC中Draw3dRect函数的功能
阅读量:4204 次
发布时间:2019-05-26

本文共 833 字,大约阅读时间需要 2 分钟。

void FillSolidRect(HDC hdc, int x, int y, int cx, int cy, COLORREF clr)

{

  RECT rect;

  SetBkColor(hdc, clr);

  rect.left = x;

  rect.top = y;

  rect.right = x + cx;

  rect.bottom = y + cy;

  ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL);

}

 

void Draw3dRect_1(HDC hdc, int x, int y, int cx, int cy, COLORREF clrTopLeft, COLORREF clrBottomRight)

{

  FillSolidRect(hdc, x, y, cx-1, 1, clrTopLeft); // top

  FillSolidRect(hdc, x, y, 1, cy-1, clrTopLeft); // left

  FillSolidRect(hdc, x+cx, y, -1, cy, clrBottomRight); // right

  FillSolidRect(hdc, x, y+cy, cx, -1, clrBottomRight); // bottom

}

 

void Draw3dRect(HDC hdc, LPCRECT lpRect, COLORREF clrTopLeft, COLORREF clrBottomRight)

{

  Draw3dRect_1(hdc, lpRect->left, lpRect->top, lpRect->right - lpRect->left, lpRect->bottom - lpRect->top, clrTopLeft, clrBottomRight);

}

 

原文地址:

转载地址:http://wssli.baihongyu.com/

你可能感兴趣的文章
在LoadRunner脚本中实现随机ThinkTime
查看>>
LoadRunner9.51中文帮助手册
查看>>
RPT录制问题
查看>>
RPT8.0
查看>>
RPT8.1新特性
查看>>
LoadRunner测试AJAX
查看>>
LoadRunner测试GWT
查看>>
负载测试项目成功的5个关键要素
查看>>
LoadRunner性能测试培训大纲
查看>>
LoadRunner测试J2ME的Socket程序
查看>>
《QTP自动化测试实践》要出第二版了!
查看>>
用LoadRunner开发开心网外挂
查看>>
QTP测试.NET控件CheckedListBox
查看>>
使用QTP的.NET插件扩展技术测试ComponentOne的ToolBar控件
查看>>
用上帝之眼进行自动化测试
查看>>
为LoadRunner写一个lr_save_float函数
查看>>
PrefTest工作室全新力作-《性能测试与调优实战》课程视频即将上线
查看>>
质量度量分析与测试技术 培训大纲
查看>>
欢迎加入【亿能测试快讯】邮件列表!
查看>>
为什么我们的自动化测试“要”这么难
查看>>