Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CGRectMBS.ApplyAffineTransform(a as CGAffineTransformMBS) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.3 Yes No No Yes, macOS only No
Function: Applies an affine transform to the rectangle and returns the result.
Example:
dim af as CGAffineTransformMBS = CGAffineTransformMBS.Identity

MsgBox str(af.A)+" "+str(af.b)+" "+str(af.c)+" "+str(af.d)+" "+str(af.tx)+" "+str(af.ty)

af = af.Scale( 1, -1 )

MsgBox str(af.A)+" "+str(af.b)+" "+str(af.c)+" "+str(af.d)+" "+str(af.tx)+" "+str(af.ty)

af = af.Translate( 0, 100 )

MsgBox str(af.A)+" "+str(af.b)+" "+str(af.c)+" "+str(af.d)+" "+str(af.tx)+" "+str(af.ty)

dim r1 as CGRectMBS
dim r2 as CGRectMBS

r1=CGMakeRectMBS(100,100,100,100)

r2=r1.ApplyAffineTransform(af)

MsgBox "("+str(r1.Left)+", "+str(r1.top)+", "+str(r1.width)+", "+str(r1.height)+") => ("+str(r2.Left)+", "+str(r2.top)+", "+str(r2.width)+", "+str(r2.height)+")"
Notes: Returns nil on any error.

Feedback, Comments & Corrections

CGRectMBS.Binary as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Returns the internal data of the object as a CGRect for use on Toolbox calls.
Example:
dim c as CGRectMBS
dim m as MemoryBlock

c=CGMakeRectMBS(10,20,30,40)

m=c.Binary

MsgBox str(m.Size) // 16
MsgBox str(m.doubleValue( 0)) // 10
MsgBox str(m.doubleValue( 4)) // 20
MsgBox str(m.doubleValue( 8)) // 30
MsgBox str(m.doubleValue(12)) // 40

Feedback, Comments & Corrections

CGRectMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: The constructor to create a zero rectangle.

See also:

Feedback, Comments & Corrections

CGRectMBS.Constructor(p as Ptr)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 17.1 Yes No No Yes, macOS only No
Function: Creates a new instance using data at the pointer.
Notes: Make sure the pointer is valid and has the right data and size.

See also:

Feedback, Comments & Corrections

CGRectMBS.Constructor(source as CGRectMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates a new CGRectMBS object by copying the values.

See also:

Feedback, Comments & Corrections

CGRectMBS.Constructor(x as Double, y as Double, width as Double, height as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates a new CGRectMBS object with the given values.

See also:

Feedback, Comments & Corrections

CGRectMBS.ContainsPoint(r as CGPointMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return true if 'point' is contained in the rect, false otherwise.

Feedback, Comments & Corrections

CGRectMBS.ContainsRect(r as CGRectMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return true if 'rect2' is contained in 'rect1', false otherwise.
Notes:
'rect2' is contained in 'rect1' if the union of 'rect1' and 'rect2' is equal to 'rect1'.
(rect1 is the current rect and rect2 the rect you pass to this function)

Feedback, Comments & Corrections

CGRectMBS.Divide(byref slice as CGRectMBS, byref remainder as CGRectMBS, amount as Double, edge as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Divides the rectangle.
Notes: Make two new rectangles, 'slice' and 'remainder', by dividing the rect with a line that's parallel to one of its sides, specified by 'edge' -- either 'CGRectMinXEdge', 'CGRectMinYEdge', 'CGRectMaxXEdge', or 'CGRectMaxYEdge'. The size of 'slice' is determined by 'amount', which measures the distance from the specified edge.

Feedback, Comments & Corrections

CGRectMBS.Equal(r as CGRectMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Returns true if both rectangles are equal.

Feedback, Comments & Corrections

CGRectMBS.Inset(dx as Double, dy as Double) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Inset the rect by '(dx, dy)' -- i.e., offset its origin by '(dx, dy)', and decrease its size by '(2*dx, 2*dy)'

Feedback, Comments & Corrections

CGRectMBS.Integral as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Expand the rect to the smallest rect containing it with integral origin and size.

Feedback, Comments & Corrections

CGRectMBS.Intersection(r as CGRectMBS) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the intersection of both rectangles.
Notes: This may return a null rect.

Feedback, Comments & Corrections

CGRectMBS.IntersectsRect(r as CGRectMBS) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return true if 'rect1' intersects 'rect2', false otherwise.
Notes: 'rect1' intersect 'rect2' if the intersection of 'rect1' and 'rect2' is not the null rect.

Feedback, Comments & Corrections

CGRectMBS.IsEmpty as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return true if the rect is empty -- i.e., if it has zero width or height.
Notes: A null rect is defined to be empty.

Feedback, Comments & Corrections

CGRectMBS.IsInfinite as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Returns whether a rectangle is infinite.
Notes:
Returns true if the specified rectangle is infinite, false otherwise.

An infinite rectangle is one that has no defined bounds. Infinite rectangles can be created as output from a tiling filter. For example, the Core Image framework perspective tile filter creates an image whose extent is described by an infinite rectangle.

Feedback, Comments & Corrections

CGRectMBS.IsNull as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return true if the rect is null -- e.g., the result of intersecting two disjoint rectangles is a null rect.

Feedback, Comments & Corrections

CGRectMBS.MaxX as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the rightmost x-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MaxX) // 40

Feedback, Comments & Corrections

CGRectMBS.MaxY as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the topmost y-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MaxY) // 60

Feedback, Comments & Corrections

CGRectMBS.MidX as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the midpoint x-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MidX) // 25

Feedback, Comments & Corrections

CGRectMBS.MidY as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the midpoint y-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MidY) // 40

Feedback, Comments & Corrections

CGRectMBS.MinX as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the leftmost x-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MinX) // 10

Feedback, Comments & Corrections

CGRectMBS.MinY as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the bottommost y-value of the rect.
Example:
dim r as CGRectMBS = CGMakeRectMBS(10, 20, 30, 40)
MsgBox str(r.MinY) // 20

Feedback, Comments & Corrections

CGRectMBS.Offset(dx as Double, dy as Double) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Offset the rect by '(dx, dy)'.

Feedback, Comments & Corrections

CGRectMBS.Standardize as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Standardize the rect -- i.e., convert it to an equivalent rect which has positive width and height.
Example:
dim r as CGRectMBS = CGRectMBS.Make(5, 6, -3, -2)
MsgBox str(r.Left)+" "+str(R.Top)+" "+str(R.Width)+" "+str(r.Height)
r = r.Standardize
MsgBox str(r.Left)+" "+str(R.Top)+" "+str(R.Width)+" "+str(r.Height)

Feedback, Comments & Corrections

CGRectMBS.Union(r as CGRectMBS) as CGRectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 3.2 Yes No No Yes, macOS only No
Function: Return the union of both rectangles.
Example:
dim r as CGRectMBS = CGRectMBS.Infinite
MsgBox str(r.Left)+" "+str(R.Top)+" "+str(R.Width)+" "+str(r.Height)

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacCG Plugin.




Links
MBS Xojo Plugins