Пример #1
0
void
Canvas::DrawButton(PixelRect rc, bool down)
{
  const Pen old_pen = pen;

  Color gray = COLOR_LIGHT_GRAY;
  DrawFilledRectangle(rc, gray);

  Pen bright(1, LightColor(gray));
  Pen dark(1, DarkColor(gray));

  Select(down ? dark : bright);
  DrawTwoLines(rc.left, rc.bottom - 2, rc.left, rc.top,
            rc.right - 2, rc.top);
  DrawTwoLines(rc.left + 1, rc.bottom - 3, rc.left + 1, rc.top + 1,
            rc.right - 3, rc.top + 1);

  Select(down ? bright : dark);
  DrawTwoLines(rc.left + 1, rc.bottom - 1, rc.right - 1, rc.bottom - 1,
            rc.right - 1, rc.top + 1);
  DrawTwoLines(rc.left + 2, rc.bottom - 2, rc.right - 2, rc.bottom - 2,
            rc.right - 2, rc.top + 2);

  pen = old_pen;
}
Пример #2
0
  void DrawRaisedEdge(PixelRect &rc) {
    Pen bright(1, Color(240, 240, 240));
    Select(bright);
    DrawTwoLines(rc.left, rc.bottom - 2, rc.left, rc.top,
              rc.right - 2, rc.top);

    Pen dark(1, Color(128, 128, 128));
    Select(dark);
    DrawTwoLines(rc.left + 1, rc.bottom - 1, rc.right - 1, rc.bottom - 1,
              rc.right - 1, rc.top + 1);

    ++rc.left;
    ++rc.top;
    --rc.right;
    --rc.bottom;
  }
Пример #3
0
 void DrawTwoLinesExact(int ax, int ay, int bx, int by, int cx, int cy) {
   DrawTwoLines(ax, ay, bx, by, cx, cy);
 }
Пример #4
0
 void DrawTwoLines(const RasterPoint a, const RasterPoint b,
                const RasterPoint c) {
   DrawTwoLines(a.x, a.y, b.x, b.y, c.x, c.y);
 }
Пример #5
0
 void DrawTwoLinesExact(PixelScalar ax, PixelScalar ay,
                        PixelScalar bx, PixelScalar by,
                        PixelScalar cx, PixelScalar cy) {
   DrawTwoLines(ax, ay, bx, by, cx, cy);
 }
Пример #6
0
 void DrawTwoLines(const PixelPoint a, const PixelPoint b,
                   const PixelPoint c) {
   DrawTwoLines(a.x, a.y, b.x, b.y, c.x, c.y);
 }