本文整理汇总了C++中Row::GetHead方法的典型用法代码示例。如果您正苦于以下问题:C++ Row::GetHead方法的具体用法?C++ Row::GetHead怎么用?C++ Row::GetHead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row::GetHead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Lookup
RenderedSubtitle* Renderer::Lookup(const Subtitle* s, const CSize& vs, const CRect& vr)
{
m_sra.UpdateTarget(vs, vr);
if(s->m_text.IsEmpty()) {
return NULL;
}
CRect spdrc = s->m_frame.reference == _T("video") ? vr : CRect(CPoint(0, 0), vs);
if(spdrc.IsRectEmpty()) {
return NULL;
}
RenderedSubtitle* rs = NULL;
if(m_rsc.Lookup(s->m_name, rs)) {
if(!s->m_animated && rs->m_spdrc == spdrc) {
return rs;
}
m_rsc.Invalidate(s->m_name);
}
const Style& style = s->m_text.GetHead().style;
Size scale;
scale.cx = (float)spdrc.Width() / s->m_frame.resolution.cx;
scale.cy = (float)spdrc.Height() / s->m_frame.resolution.cy;
CRect frame;
frame.left = (int)(64.0f * (spdrc.left + style.placement.margin.l * scale.cx) + 0.5);
frame.top = (int)(64.0f * (spdrc.top + style.placement.margin.t * scale.cy) + 0.5);
frame.right = (int)(64.0f * (spdrc.right - style.placement.margin.r * scale.cx) + 0.5);
frame.bottom = (int)(64.0f * (spdrc.bottom - style.placement.margin.b * scale.cy) + 0.5);
CRect clip;
if(style.placement.clip.l == -1) {
clip.left = 0;
} else {
clip.left = (int)(spdrc.left + style.placement.clip.l * scale.cx);
}
if(style.placement.clip.t == -1) {
clip.top = 0;
} else {
clip.top = (int)(spdrc.top + style.placement.clip.t * scale.cy);
}
if(style.placement.clip.r == -1) {
clip.right = vs.cx;
} else {
clip.right = (int)(spdrc.left + style.placement.clip.r * scale.cx);
}
if(style.placement.clip.b == -1) {
clip.bottom = vs.cy;
} else {
clip.bottom = (int)(spdrc.top + style.placement.clip.b * scale.cy);
}
clip.left = max(clip.left, 0);
clip.top = max(clip.top, 0);
clip.right = min(clip.right, vs.cx);
clip.bottom = min(clip.bottom, vs.cy);
scale.cx *= 64;
scale.cy *= 64;
bool vertical = s->m_direction.primary == _T("down") || s->m_direction.primary == _T("up");
// create glyph paths
WCHAR c_prev = 0, c_next;
CAutoPtrList<Glyph> glyphs;
POSITION pos = s->m_text.GetHeadPosition();
while(pos) {
const Text& t = s->m_text.GetNext(pos);
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfCharSet = DEFAULT_CHARSET;
_tcscpy_s(lf.lfFaceName, CString(t.style.font.face));
lf.lfHeight = (LONG)(t.style.font.size * scale.cy + 0.5);
lf.lfWeight = (LONG)(t.style.font.weight + 0.5);
lf.lfItalic = !!t.style.font.italic;
lf.lfUnderline = !!t.style.font.underline;
lf.lfStrikeOut = !!t.style.font.strikethrough;
lf.lfOutPrecision = OUT_TT_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = ANTIALIASED_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
FontWrapper* font = m_fc.Create(m_hDC, lf);
if(!font) {
_tcscpy_s(lf.lfFaceName, _T("Arial"));
//.........这里部分代码省略.........