本文整理汇总了C++中Draw::BeginGdi方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::BeginGdi方法的具体用法?C++ Draw::BeginGdi怎么用?C++ Draw::BeginGdi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::BeginGdi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawDragDropRect
void DrawDragDropRect(Draw& draw, const Rect& rc_old, const Rect& rc_new, int width, Color c1, Color c2)
{
#ifdef PLATFORM_WIN32
#ifdef SYSTEMDRAW
SystemDraw *w = dynamic_cast<SystemDraw *>(&draw);
if(w) { SystemDraw& draw = *w;
#endif
static const word halftone[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
HBITMAP bitmap = CreateBitmap(8, 8, 1, 1, halftone);
HBRUSH brush = CreatePatternBrush(bitmap);
DeleteObject(bitmap);
draw.BeginGdi();
SetTextColor(draw, c1);
SetBkColor(draw, c2);
if(!IsNull(rc_old))
DrawDragDropRectRaw(draw, rc_old, brush, width);
if(!IsNull(rc_new))
DrawDragDropRectRaw(draw, rc_new, brush, width);
DeleteObject(brush);
draw.EndGdi();
#ifdef SYSTEMDRAW
}
#endif
#endif
#ifdef PLATFORM_X11
XGCValues gcv_old, gcv_new;
XGetGCValues(Xdisplay, draw.GetGC(), GCForeground | GCFunction, &gcv_old);
gcv_new.function = X11_ROP2_XOR;
gcv_new.foreground = GetXPixel(c1);
XChangeGC(Xdisplay, draw.GetGC(), GCForeground | GCFunction, &gcv_new);
if(!IsNull(rc_old))
DrawDragDropRectRaw(draw, rc_old, width);
if(!IsNull(rc_new))
DrawDragDropRectRaw(draw, rc_new, width);
XChangeGC(Xdisplay, draw.GetGC(), GCForeground | GCFunction, &gcv_old);
#endif
}