MuPDFCore 1.8.0
Multiplatform .NET bindings for MuPDF
Loading...
Searching...
No Matches
MuPDFCore.Rectangle Struct Reference

Represents a rectangle. More...

Public Member Functions

 Rectangle (float x0, float y0, float x1, float y1)
 Create a new Rectangle from the specified coordinates. More...
 
 Rectangle (double x0, double y0, double x1, double y1)
 Create a new Rectangle from the specified coordinates. More...
 
RoundedRectangle Round ()
 Round the rectangle's coordinates to the closest integers. More...
 
RoundedRectangle Round (double zoom)
 Round the rectangle's coordinates to the closest integers, applying the specified zoom factor. More...
 
Rectangle[] Split (int divisions)
 Split the rectangle into the specified number of Rectangles. More...
 
Rectangle Intersect (Rectangle other)
 Compute the intersection between this Rectangle and another one. More...
 
bool Contains (Rectangle other)
 Checks whether this Rectangle contains another Rectangle. More...
 
bool Contains (PointF point)
 Checks whether this Rectangle contains a PointF. More...
 
Quad ToQuad ()
 Converts the Rectangle to a Quad. More...
 

Public Attributes

float X0
 The left coordinate of the rectangle. More...
 
float Y0
 The top coordinate of the rectangle. More...
 
float X1
 The right coordinate of the rectangle. More...
 
float Y1
 The bottom coordinate of the rectangle. More...
 

Properties

float Width [get]
 The width of the rectangle. More...
 
float Height [get]
 The height of the rectangle. More...
 

Detailed Description

Represents a rectangle.

Definition at line 326 of file Rectangles.cs.

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

MuPDFCore.Rectangle.Rectangle ( float  x0,
float  y0,
float  x1,
float  y1 
)

Create a new Rectangle from the specified coordinates.

Parameters
x0The left coordinate of the rectangle.
y0The top coordinate of the rectangle.
x1The right coordinate of the rectangle.
y1The bottom coordinate of the rectangle.

Definition at line 365 of file Rectangles.cs.

◆ Rectangle() [2/2]

MuPDFCore.Rectangle.Rectangle ( double  x0,
double  y0,
double  x1,
double  y1 
)

Create a new Rectangle from the specified coordinates.

Parameters
x0The left coordinate of the rectangle.
y0The top coordinate of the rectangle.
x1The right coordinate of the rectangle.
y1The bottom coordinate of the rectangle.

Definition at line 380 of file Rectangles.cs.

Member Function Documentation

◆ Contains() [1/2]

bool MuPDFCore.Rectangle.Contains ( PointF  point)

Checks whether this Rectangle contains a PointF.

Parameters
pointThe PointF to check.
Returns
A boolean value indicating whether this Rectangle contains the point .

Definition at line 476 of file Rectangles.cs.

◆ Contains() [2/2]

bool MuPDFCore.Rectangle.Contains ( Rectangle  other)

Checks whether this Rectangle contains another Rectangle.

Parameters
otherThe Rectangle to check.
Returns
A boolean value indicating whether this Rectangle contains the other Rectangle.

Definition at line 466 of file Rectangles.cs.

◆ Intersect()

Rectangle MuPDFCore.Rectangle.Intersect ( Rectangle  other)

Compute the intersection between this Rectangle and another one.

Parameters
otherThe other Rectangle to intersect with this instance.
Returns
The intersection between the two Rectangles.

Definition at line 443 of file Rectangles.cs.

◆ Round() [1/2]

RoundedRectangle MuPDFCore.Rectangle.Round ( )

Round the rectangle's coordinates to the closest integers.

Returns
A RoundedRectangle with the rounded coordinates.

Definition at line 392 of file Rectangles.cs.

◆ Round() [2/2]

RoundedRectangle MuPDFCore.Rectangle.Round ( double  zoom)

Round the rectangle's coordinates to the closest integers, applying the specified zoom factor.

Parameters
zoomThe zoom factor to apply.
Returns
A RoundedRectangle with the rounded coordinates.

Definition at line 407 of file Rectangles.cs.

◆ Split()

Rectangle[] MuPDFCore.Rectangle.Split ( int  divisions)

Split the rectangle into the specified number of Rectangles.

Parameters
divisionsThe number of rectangles in which the rectangle should be split. This must be factorisable using only powers of 2, 3, 5 or 7. Otherwise, the biggest number smaller than divisions that satisfies this condition is used.
Returns
An array of Rectangles that when positioned properly cover the same area as this object.

Definition at line 422 of file Rectangles.cs.

◆ ToQuad()

Quad MuPDFCore.Rectangle.ToQuad ( )

Converts the Rectangle to a Quad.

Returns
A Quad corresponding to the current Rectangle.

Definition at line 485 of file Rectangles.cs.

Member Data Documentation

◆ X0

float MuPDFCore.Rectangle.X0

The left coordinate of the rectangle.

Definition at line 331 of file Rectangles.cs.

◆ X1

float MuPDFCore.Rectangle.X1

The right coordinate of the rectangle.

Definition at line 341 of file Rectangles.cs.

◆ Y0

float MuPDFCore.Rectangle.Y0

The top coordinate of the rectangle.

Definition at line 336 of file Rectangles.cs.

◆ Y1

float MuPDFCore.Rectangle.Y1

The bottom coordinate of the rectangle.

Definition at line 346 of file Rectangles.cs.

Property Documentation

◆ Height

float MuPDFCore.Rectangle.Height
get

The height of the rectangle.

Definition at line 356 of file Rectangles.cs.

◆ Width

float MuPDFCore.Rectangle.Width
get

The width of the rectangle.

Definition at line 351 of file Rectangles.cs.


The documentation for this struct was generated from the following file: