Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CGAffineTransformMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics MBS MacCG Plugin 3.4 Yes No No Yes, macOS only No
Function: A class for an affine transformation.
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)+")"

Feedback, Comments & Corrections

  • 6 properties
    • property A as Double
    • property B as Double
    • property C as Double
    • property D as Double
    • property TX as Double
    • property TY as Double
  • 11 methods
    • method Binary as MemoryBlock
    • method Concat(t as CGAffineTransformMBS) as CGAffineTransformMBS
    • method Constructor
    • method Constructor(a as Double, b as Double, c as Double, d as Double, tx as Double, ty as Double)
    • method Constructor(p as Ptr)
    • method EqualToTransform(t as CGAffineTransformMBS) as boolean
    • method Invert as CGAffineTransformMBS
    • method IsIdentity as boolean
    • method Rotate(angle as Double) as CGAffineTransformMBS
    • method Scale(sx as Double, sy as Double) as CGAffineTransformMBS
    • method Translate(tx as Double, ty as Double) as CGAffineTransformMBS
  • 5 shared methods
    • shared method Identity as CGAffineTransformMBS
    • shared method Make(a as Double, b as Double, c as Double, d as Double, tx as Double, ty as Double) as CGAffineTransformMBS
    • shared method MakeRotation(angle as Double) as CGAffineTransformMBS
    • shared method MakeScale(sx as Double, sy as Double) as CGAffineTransformMBS
    • shared method MakeTranslation(tx as Double, ty as Double) as CGAffineTransformMBS

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some examples which use this class:


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


CFXMLProcessingInstructionInfoMBS   -   CGBitmapContextMBS




Links
MBS Xojo tutorial videos