draw text along line
or
draw rotate text
void CAestheticLinesView::OnLButtonUp(UINT nFlags, CPoint point)
{ if (m_bTracking)
{
m_bTracking = FALSE;
if (GetCapture () == this)
::ReleaseCapture ();
CClientDC dc (this);
InvertLine (&dc, m_ptFrom, m_ptTo);
CPen pen (PS_SOLID, 2, RGB (0, 128,0));
dc.SelectObject (&pen); if(point.x-m_ptFrom.x==0) return;
float slope= -(point.y -m_ptFrom.y)/(point.x-m_ptFrom.x); float ang=atan2(m_ptFrom.y-point.y,point.x-m_ptFrom.x)*180.0f/3.1415927f;
LOGFONT lf;
lf.lfCharSet=SYMBOL_CHARSET; lf.lfHeight=60;
lf.lfEscapement=(long)ang*10; lf.lfOrientation=(long)ang*10; lf.lfItalic=false;
lf.lfStrikeOut=false;
lf.lfUnderline=false;
lf.lfQuality=ANTIALIASED_QUALITY;
strcpy(lf.lfFaceName,_T("Wingdings"));
CFont fnt;
fnt.CreateFontIndirect(&lf); dc.SetBkMode(TRANSPARENT); dc.SelectObject(fnt);
CString str;
str=0x96;
CSize sz=dc.GetTextExtent(str); int textwidth= sz.cx; float dist= sqrt( (point.y - m_ptFrom.y )*(point.y-m_ptFrom.y )+(point.x-m_ptFrom.x)*(point.x-m_ptFrom.x) ) ; while(textwidth < dist )
{
str+=0x96;
textwidth=dc.GetTextExtent(str).cx;
} dc.SetTextColor(RGB(0,128,0));
dc.TextOut(m_ptFrom.x,m_ptFrom.y,str);
}
CView::OnLButtonUp(nFlags, point);
}