SOL9 2.0 Class: Point

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * Point.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL++2000
#pragma once

#include <sol\Shape.h>

namespace SOL {

class Point :public Shape {
    int x1, y1;
    COLORREF color;
  public:
    Point(int p1, int q1) {
        x1 = p1; y1 = q1;
        color = RGB(0, 0, 0); // Black;
    }
    void    draw(DC* dc) {
          dc -> setPixel(x1, y1, color);
    }
    void    draw(DC* dc, int x, int y) {
          dc -> setPixel(x+x1, y+y1, color);
    }
    void    get(int* p1, int* q1) {
          *p1 = x1; *q1 = y1;
    }
    void    get(COLORREF* color1) {
          *color1 = color;
    }
    void    move(int x, int y) {
          x1 += x; y1 += y;
    }
    void    set(int p1, int q1) {
          x1 = p1; y1 = q1;
    }
    void    set(COLORREF color1) {
          color = color1;
    }
};

}



Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.