- 原图:
- 程序实现:
- 步骤
Step1:填充背景色
Step2:根据坐标点的位置画线
Step3:logo下文字
void CFirstMFCLineView::OnLogoCreativeaudio()
{
CPen m_pen[10];
CBrush m_brush[5];
m_pen[0].CreatePen(PS_SOLID, 1, RGB(255, 0, 0));
m_pen[1].CreatePen(PS_INSIDEFRAME, 8, RGB(0, 0, 0));
m_pen[2].CreatePen(PS_COSMETIC, 1, RGB(255, 105, 13));
m_brush[0].CreateSolidBrush(RGB(255, 105, 13));
m_pDC = new CClientDC(this);
CBrush backBrush(RGB(55, 59, 60));
CRect rect1(100, 60, 350, 330);
m_pDC->GetClipBox(&rect1);
m_pDC->PatBlt(rect1.left, rect1.top, rect1.Width(), rect1.Height(), PATCOPY);
CFont font;
font.CreateFont(
44,
22,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("华文细黑"));
m_pDC->SelectObject(&font);
COLORREF color1 = RGB(255, 255, 255);
COLORREF color2 = RGB(55, 59, 60);
m_pDC->SetTextColor(color1);
m_pDC->SetBkColor(color2);
LPCWSTR text1 = TEXT("CREATIVE AUDIO");
m_pDC->TextOut(73, 323, text1, lstrlen(text1));
CRect rect(140, 200, 300, 300);
rect.OffsetRect(80, 0);
m_pDC->SelectObject(&m_pen[1]);
m_pDC->Arc(143, 198, 300, 285, 288, 221, 205, 277);
m_pDC->SelectObject(m_pen[2]);
m_pDC->SelectObject(m_brush[0]);
CPoint pt1[4] = { CPoint(250,93),CPoint(292,220) ,CPoint(287, 227),CPoint(250,113) };
m_pDC->Polygon(pt1, 4);
CPoint pt2[4] = { CPoint(210,278),CPoint(203,283) , CPoint(250,93),CPoint(250,113) };
m_pDC->Polygon(pt2, 4);
}