ImageView

class mono::ui::ImageView

<# brief desc #>

Inherits from mono::ui::View

Public Functions

ImageView()

Construct an empty image view, where no image is displayed To display an image you need to call setImage later.

ImageView(media::Image *img)

Construct an UI image from an image file

At the moment only BMP images are supported! Remember to initialize the mbed class object before calling this consructor!

void setImage(media::Image *img)

Set a new image source object Note: This method also resets the current cropping rectangle!

virtual void repaint()

Repaint the view content, using the View::painter.

Re-paint the view content. This method should be called then the view content has changed. You can call this method directly, but it might cause graphics artifacts because the display is not double buffered. Instead you should schedule a repaint by calling the scheduleRepaint() method. This method will schedule the repaint, right after the next display update.

The display system will not schedule any repaints automatically. The view does not contain any state information, so you or other classes utilizing view must schedule repaints.

In subclasses of View, this method must be overwritten.

Protected Attributes

media::Image *image

A pointer to the Image object that is to be displayed in the screen.

geo::Rect crop

Image crop rectangle. Setting this rect will crop the source image (non destructive).