PaintContext Class Reference

#include <Pt/Forms/PaintContext.h>

Active painting session on a Forms paint surface. More...

Inherits PaintContext.

Public Member Functions

 PaintContext (PaintSurface &surface)
 Constructs a context for surface.
 PaintContext (PaintSurface &surface, const Gfx::RectF &clip)
 Constructs a context for surface with initial clip clip.
 ~PaintContext ()
 Destructor.
PaintSurface & paintSurface ()
 Returns the Forms paint surface.
const Gfx::ImageFormatformat () const
 Returns the image format.
const Gfx::SizeF & size () const
 Returns the size in physical pixels.
const Scaling & scaling () const
 Returns the scaling from logical to physical pixels.
const RectF * clip () const
 Returns the default clip rect or null if clipping is disabled.
void setClip (const RectF &clip)
 Sets the default clip rect for painters on this context.
void resetClip ()
 Resets the default clip rect.
Canvas * getCanvas (Canvas *canvas)
 Returns a canvas for backend drawing.
void sync ()
 Synchronizes pending drawing operations.
void finish ()
 Finishes painting on the surface.

Protected Member Functions

virtual void onDetachSurface (Gfx::PaintSurface &surface) override
 Clears the Forms surface binding when the Gfx surface detaches.

Detailed Description

PaintContext extends Gfx::PaintContext. It is the argument to onPaint() and does not own the surface. Its lifetime is the paint call.