Download Now

    Reference ISurface

    Declared in Codebot.Graphics.Types.pas on line 1050

      ISurface = interface
      public
        { Wait for drawing operations to complete }
        procedure Flush;
        { Fill the entire surface with a color }
        procedure Clear(Color: TColorB);
        { Copy an area from one surface to another optionally alpha blending the
          result }
        procedure CopyTo(const Source: TRectF; Surface: ISurface; const Dest: TRectF; Alpha: Byte = $FF; Quality: TResampleQuality = rqNormal);
        { Push the current path, matrix, and clipping area onto a stack }
        procedure Save;
        { Pop the path, matrix, and clipping area from a stack }
        procedure Restore;
        { Move to a new position creating a new sub path }
        procedure MoveTo(X, Y: Float);
        { Line to a new position adding to the current path }
        procedure LineTo(X, Y: Float);
        { Arc to a new position adding to the current path }
        procedure ArcTo(const Rect: TRectF; BeginAngle, EndAngle: Float);
        { Bezier curve to a new position adding to the current path }
        procedure CurveTo(X, Y: Float; const C1, C2: TPointF);
        { Ellipse as a new sub path }
        procedure Ellipse(const Rect: TRectF);
        { Rectangle as a new sub path }
        procedure Rectangle(const Rect: TRectF);
        { Round rectangle as a new sub path }
        procedure RoundRectangle(const Rect: TRectF; Radius: Float);
        { TextSize returns the number of pixels needed to fit a single line of text }
        function TextSize(Font: IFont; const Text: string): TPointF;
        { TextHeight returns the number of vertical pixels needed to fit text given
          a wrappable width }
        function TextHeight(Font: IFont; const Text: string; Width: Float): Float;
        { TextOut writes text. When immediate is true no path is created. }
        procedure TextOut(Font: IFont; const Text: string; const Rect: TRectF; Direction: TDirection; Immediate: Boolean = True);
        { Stroke the current path optionally preserving it }
        procedure Stroke(Pen: IPen; Preserve: Boolean = False);
        { Fill the current path optionally preserving it }
        procedure Fill(Brush: IBrush; Preserve: Boolean = False);
        { Stroke a rect aligning its pixels to the pen width }
        procedure StrokeRect(Pen: IPen; const Rect: TRectF);
        { Fill a rect aligning its pixels evenly within the rect }
        procedure FillRect(Brush: IBrush; const Rect: TRectF);
        { Stroke a round rect aligning its pixels to the pen width }
        procedure StrokeRoundRect(Pen: IPen; const Rect: TRectF; Radius: Float);
        { Fill a round rect aligning its pixels evenly within the rect }
        procedure FillRoundRect(Brush: IBrush; const Rect: TRectF; Radius: Float);
        { Matrix is used to rotate, scale, and translate rendering }
        property Matrix: IMatrix read GetMatrix write SetMatrix;
        { The current path which can be stroked or filled }
        property Path: IPath read GetPath;
        { The underlying platform drawing handle }
        property Handle: Pointer read GetHandle;
      end;

    See also

    Float in Codebot.System.pas