System.Types.TRectF.Create
Delphi
constructor Create(const Origin: TPointF); overload; // empty rect at given origin
constructor Create(const Origin: TPointF; const Width, Height: Single); overload; // at TPoint of origin with width and height
constructor Create(const Left, Top, Right, Bottom: Single); overload; // at Left, Top, Right, and Bottom
constructor Create(const P1, P2: TPointF; Normalize: Boolean = False); overload; // with corners specified by p1 and p2
constructor Create(const R: TRectF; Normalize: Boolean = False); overload;
constructor Create(const R: TRect; Normalize: Boolean = False); overload;
C++
TRectF() _ALWAYS_INLINE
TRectF(const TPointF& TL) _ALWAYS_INLINE {
TRectF(const TPointF& TL, float width, float height) _ALWAYS_INLINE {
TRectF(float l, float t, float r, float b) _ALWAYS_INLINE {
TRectF(const TPointF& TL, const TPointF& BR) _ALWAYS_INLINE {
TRectF(const RECT& r) _ALWAYS_INLINE {
Eigenschaften
Typ | Sichtbarkeit | Quelle | Unit | Übergeordnet |
---|---|---|---|---|
constructor | public | System.Types.pas SystemTypes.h |
System.Types | TRectF |
Beschreibung
Erstellt ein TRectF-Rechteck mit Gleitkommakoordinaten.
Mit Create können Sie ein neues rechteckiges TRectF-Objekt mit Single-Koordinaten erstellen und initialisieren:
- Origin und P1 repräsentieren die linke obere Ecke des Rechtecks als Punkt (mit dem Typ TPointF).
- P2 repräsentiert die rechte untere Ecke des Rechtecks als Punkt (mit dem Typ TPointF).
- Top, Bottom, Right und Left sind vertikale oder horizontale Single-Koordinaten der oberen, unteren, rechten bzw. linken Seite des Rechtecks.
- Width und Height sind die Single-Breite bzw. -Höhe des Rechtecks.
- R ist das Rechteck, dessen Koordinaten durch den Typ TRectF (oder TRect) angegebenen sind.
- Normalize legt fest, wie ein normalisiertes Rechteck erstellt wird.
- Hinweis:
Create(const Origin: TPointF)
erstellt ein leeres Rechteck an dem angegebenen Ursprung (Origin).