MCPcopy Create free account
hub / github.com/cinience/RedisStudio / DrawLine

Method DrawLine

DuiLib/Core/UIRender.cpp:1168–1183  ·  view source on GitHub ↗

��������: DrawLine ��������: void ������Ϣ: HDC hDC ������Ϣ: const RECT & rc ������Ϣ: int nSize ������Ϣ: DWORD dwPenColor ������Ϣ: int nStyle ����˵��:

Source from the content-addressed store, hash-verified

1166// ����˵��:
1167//************************************
1168void CRenderEngine::DrawLine( HDC hDC, const RECT& rc, int nSize, DWORD dwPenColor,int nStyle /*= PS_SOLID*/ )
1169{
1170 ASSERT(::GetObjectType(hDC)==OBJ_DC || ::GetObjectType(hDC)==OBJ_MEMDC);
1171
1172 LOGPEN lg;
1173 lg.lopnColor = RGB(GetBValue(dwPenColor), GetGValue(dwPenColor), GetRValue(dwPenColor));
1174 lg.lopnStyle = nStyle;
1175 lg.lopnWidth.x = nSize;
1176 HPEN hPen = CreatePenIndirect(&lg);
1177 HPEN hOldPen = (HPEN)::SelectObject(hDC, hPen);
1178 POINT ptTemp = { 0 };
1179 ::MoveToEx(hDC, rc.left, rc.top, &ptTemp);
1180 ::LineTo(hDC, rc.right, rc.bottom);
1181 ::SelectObject(hDC, hOldPen);
1182 ::DeleteObject(hPen);
1183}
1184
1185void CRenderEngine::DrawRect(HDC hDC, const RECT& rc, int nSize, DWORD dwPenColor)
1186{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected