本文整理汇总了C++中Draw::Clipoff方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::Clipoff方法的具体用法?C++ Draw::Clipoff怎么用?C++ Draw::Clipoff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::Clipoff方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Paint
void RichTextView::Paint(Draw& w)
{
Size sz = GetSize();
w.DrawRect(sz, background);
sz.cx -= margin.left + margin.right;
sz.cy -= margin.top + margin.bottom;
w.Clipoff(margin.left, margin.top, sz.cx, sz.cy);
PaintInfo pi;
if(!hldec)
pi.hyperlink = Null;
if(sell < selh) {
pi.sell = sell;
pi.selh = selh;
}
pi.indexentry = Null;
pi.highlightpara = highlight;
pi.zoom = GetZoom();
int q = sb * pi.zoom;
scroller.Set(q);
w.Offset(0, -q);
SimplePageDraw pw(w);
pi.top = PageY(0, sb);
pi.bottom = PageY(0, sb + sz.cy / pi.zoom);
pi.usecache = true;
pi.sizetracking = sizetracking;
pi.shrink_oversized_objects = shrink_oversized_objects;
Color c = SColorPaper();
if(Grayscale(c) < 100)
pi.coloroverride = true;
text.Paint(pw, GetPage(), pi);
w.End();
w.End();
}
示例2: Paint
void Picture::Paint(Draw& w) {
Size sz = GetSize();
w.DrawRect(0, 0, sz.cx, sz.cy, background);
if(!picture) return;
int dx = 0;
int dy = 0;
Size rz = sz;
if(ratio) {
Size sr = picture.GetSize();
if(sr.cy * sz.cx < sz.cy * sr.cx) {
if(sr.cx) {
rz.cy = sr.cy * sz.cx / sr.cx;
dy = (sz.cy - rz.cy) / 2;
}
}
else {
if(sr.cy) {
rz.cx = sr.cx * sz.cy / sr.cy;
dx = (sz.cx - rz.cx) / 2;
}
}
}
w.Clipoff(dx, dy, rz.cx, rz.cy);
w.DrawDrawing(0, 0, rz.cx, rz.cy, picture);
w.End();
}
示例3: Paint
void QTFDisplayCls::Paint(Draw& draw, const Rect& r, const Value& v, Color ink, Color paper, dword style) const
{
String s;
s << "[@(" << ink.GetR() << "." << ink.GetG() << "." << ink.GetB() << ") " << v;
RichText rtext = ParseQTF(s);
rtext.ApplyZoom(GetRichTextStdScreenZoom());
draw.DrawRect(r, paper);
draw.Clipoff(r);
rtext.Paint(Zoom(1, 1), draw, 0, 0, r.Width());
draw.End();
}
示例4: DrawFocus
void DrawFocus(Draw& w, int x, int y, int cx, int cy, Color c) {
w.Clipoff(x, y, cx, cy);
for(int a = 0; a < cx; a += CtrlImg::focus_h().GetWidth()) {
w.DrawImage(a, 0, CtrlImg::focus_h(), c);
w.DrawImage(a, cy - 1, CtrlImg::focus_h(), c);
}
for(int a = 0; a < cy; a += CtrlImg::focus_v().GetHeight()) {
w.DrawImage(0, a, CtrlImg::focus_v(), c);
w.DrawImage(cx - 1, a, CtrlImg::focus_v(), c);
}
w.End();
}
示例5: Paint
virtual void Paint(Draw& w) {
w.DrawRect(GetSize(), White());
DoPainting(w);
w.Offset(30, 50);
DoPainting(w);
w.End();
w.Offset(20, 100);
w.Clip(5, 5, 40, 20);
DoPainting(w);
w.End();
w.End();
w.Clipoff(10, 150, 60, 20);
DoPainting(w);
w.End();
}
示例6: Paint
virtual void Paint(Draw& w)
{
Size sz = GetSize();
w.DrawRect(sz, LtGray);
w.DrawRect(sz / 2, LtBlue);
w.DrawText(10, 10, "Hello", Arial(12));
w.DrawImage(50, 50, CtrlImg::exclamation());
w.DrawImage(100, 50, CtrlImg::exclamation(), Blue);
w.DrawImage(50, 150, CtrlsImg::O1h());
w.DrawImage(150, 150, CtrlsImg::O1h());
w.Clipoff(50, 180, 40, 40);
w.DrawImage(0, 0, 50, 50, CtrlsImg::O1h());
w.End();
w.DrawImage(100, 100, ball);
w.DrawImage(200, 200, 40, 40, ball);
}