#include <Pt/Forms/Pixmap.h>

Off-screen Forms paint surface. More...

Inherits PaintSurface.

Public Member Functions

 Pixmap ()
 Creates an empty pixmap.
virtual ~Pixmap ()
 Destructor.
void reset ()
 Clears the pixmap.
void reset (const Gfx::Image &image)
 Resets the pixmap from image.
void reset (const Gfx::SizeF &size)
 Resets the pixmap to size in physical pixels.
bool empty () const
 Returns true when the pixmap has no size.
void getBitmap (Gfx::Bitmap &image, const Gfx::RectF &rect)
 Copies rect into image.
void setScaleFactor (double v)
 Sets the scale factor to v.
IPixmapImplimpl ()
 Returns the platform pixmap implementation.
const IPixmapImplimpl () const
 Returns the platform pixmap implementation.
void drawPixmap (Gfx::Canvas &canvas, const Gfx::PointF &to, const Pixmap &pixmap, const Gfx::RectF *rect=0)
 Draws pixmap onto canvas at to.
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.
Canvas * getCanvas (Canvas *canvas)
 Returns a canvas for backend drawing.
void sync ()
 Synchronizes pending operations to the surface.
void finish ()
 Finishes painting to the surface.

Protected Member Functions

virtual void onDrawPixmap (Gfx::Canvas &canvas, const Gfx::PointF &to, const Pixmap &pixmap, const Gfx::RectF *rect=0) override
 Draws pixmap onto canvas at to.
virtual const Gfx::ImageFormatonGetFormat () const override
 Returns the image format.
virtual const Gfx::SizeF & onGetSize () const override
 Returns the size in physical pixel.
virtual const Gfx::ScalingonGetScaling () const override
 Returns the scaling fro logical to physical pixels.
virtual Gfx::CanvasonGetCanvas (Gfx::Canvas *reuse) override
 Returns a reusable canvas instance.
virtual Gfx::CanvasonCreateCanvas (Gfx::Canvas *reuse) override
 Creates a Canvas.
virtual void onReleaseCanvas () override
 Releases the current Canvas.
virtual void onSync () override
 Synchronizes pending operations to the surface.
virtual void onFinish () override
 Finishes painting to the surface.
void invalidate ()
 Invalidates the currently active paint canvas.

Detailed Description

A Pixmap is a PaintSurface used as a back buffer or as cached image content. Reset it from an image or a size in physical pixels.

Member Function Documentation

◆ impl() [1/2]

IPixmapImpl * impl ( )

This is an implementation API for Forms backends.

◆ impl() [2/2]

const IPixmapImpl * impl ( ) const

This is an implementation API for Forms backends.

◆ drawPixmap()

void drawPixmap ( Gfx::Canvas & canvas,
const Gfx::PointF & to,
const Pixmap & pixmap,
const Gfx::RectF * rect = 0 )
inherited

When rect is not null, only that region of the pixmap is drawn.