Anzeigen: Delphi C++
Anzeigeeinstellungen

System.Types.TSize

Aus XE2 API Documentation
Wechseln zu: Navigation, Suche

Delphi

  TSize = record
    cx: Longint;
    cy: Longint;
  public
    constructor Create(P : TSize); overload;
    constructor Create(const X, Y : Integer); overload;
    class operator Equal(const Lhs, Rhs : TSize) : Boolean;
    class operator NotEqual(const Lhs, Rhs : TSize): Boolean;
    class operator Add(const Lhs, Rhs : TSize): TSize;
    class operator Subtract(const Lhs, Rhs : TSize): TSize;
    function Add(const Point: TSize): TSize;
    function Distance(const P2 : TSize) : Double;
    function IsZero : Boolean;
    function Subtract(const Point: TSize): TSize;
    property Width: Integer read cx write cx;
    property Height: Integer read cy write cy;
  end;

C++

struct TSize: public tagSIZE {TSize() {
this->cx = this->cy = 0;
}
TSize(const tagSIZE& ts)
{
this->cx = ts.cx;
this->cy = ts.cy;
}
TSize(int32_t x, int32_t y)
{
this->cx = x;
this->cy = y;
}
bool operator ==(const TSize& ts) const {
return this->cx == ts.cx && this->cy == ts.cy;
}
bool operator !=(const TSize& ts) const {
return !(*this == ts);
}
TSize operator +(const TSize& rhs) const {
return TSize(this->cx + rhs.cx, this->cy + rhs.cy);
}
TSize operator -(const TSize& rhs) const {
return TSize(this->cx - rhs.cx, this->cy - rhs.cy);
}
TSize& operator+= (const TSize& rhs) {
this->cx += rhs.cx;
this->cy += rhs.cy;
return *this;
}
TSize& operator-= (const TSize& rhs) {
this->cx -= rhs.cx;
this->cy -= rhs.cy;
return *this;
}
bool IsZero() const {
return !cx && !cy;
}
__property LONG Width =  { read=cx,   write=cx  };
__property LONG Height = { read=cy,   write=cy  };
};

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
struct
class
public
System.Types.pas
System.Types.hpp
System.Types System.Types

Beschreibung

Gibt die Breite und Höhe eines Objekts an.

TSize gibt die Größe eines Objekts an. Das Objekt kann ein Rechteck, ein Formular, eine Schaltfläche usw. sein. Standardmäßig wird die Maßeinheit Pixel zugrunde gelegt.

cx ist die Breite.

cy ist die Höhe.

Siehe auch

Frühere Versionen
Übersetzungen