Photon microGUI widgets library 0.6.0
PhWidgets::Drawing::Image Class Reference

An abstract base class that provides functionality for the Drawing::Bitmap class. More...

#include <Image.h>

Public Member Functions

 Image (const PhImage_t &image)
 (copy constructor) More...
 
 Image (const Image &other)
 (copy constructor) More...
 
 operator PhImage_t * () const
 Converts to the pointer to PhImage_t struct. More...
 

Static Public Member Functions

static Image FromFile (std::string filename)
 Creates an Image from the specified file. More...
 

Public Attributes

Properties


const PhDim_t Size
 Gets the width and height, in pixels, of this Image. More...
 
const unsigned short Width
 Gets the width, in pixels, of this Image. More...
 
const unsigned short Height
 Gets the height, in pixels, of this Image. More...
 

Detailed Description

An abstract base class that provides functionality for the Drawing::Bitmap class.

Remarks
To draw an Image on a Form, you should use one of the Drawing::Graphics::DrawImage methods.
See also

Constructor & Destructor Documentation

◆ Image() [1/2]

PhWidgets::Drawing::Image::Image ( const PhImage_t image)

(copy constructor)

Constructs an Image from PhImage_t.

Parameters
[in]imagePhImage_t to be used as source to initialize the elements of the container with.
Attention
Image class makes copy of image provided so input PhImage_t remains untouched.
Remarks
You can create an Image using Image::FromFile(), Image::FromHbitmap(), Image::FromStream() functions.
See also

◆ Image() [2/2]

PhWidgets::Drawing::Image::Image ( const Image other)

(copy constructor)

Constructs an Image by copy.

Parameters
[in]otherAnother Image to be used as source to initialize the elements of the container with.
Remarks
You can create an Image using Image::FromFile(), Image::FromHbitmap(), Image::FromStream() functions.
See also

Member Function Documentation

◆ FromFile()

static Image PhWidgets::Drawing::Image::FromFile ( std::string  filename)
static

Creates an Image from the specified file.

Parameters
[in]filenameA string that contains the name of the file from which to create the Image.
Returns
The Image this method creates.
Exceptions
std::ios_base::failure
Remarks
Photon has built-in encoders and decoders that support the following file types:
  • BMP
  • GIF
  • JPEG
  • PNG
  • PCX
  • SGI

The file remains locked until the Image is disposed.

Note
The Image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.
See also
  • Image::FromHbitmap()
  • Image::FromStream()

◆ operator PhImage_t *()

PhWidgets::Drawing::Image::operator PhImage_t * ( ) const

Converts to the pointer to PhImage_t struct.

Returns
The pointer to PhImage_t struct with the Image or nullptr.

Member Data Documentation

◆ Height

const unsigned short PhWidgets::Drawing::Image::Height

Gets the height, in pixels, of this Image.

Property Value

unsigned short

The height, in pixels, of this Image.

See also

◆ Size

const PhDim_t PhWidgets::Drawing::Image::Size

Gets the width and height, in pixels, of this Image.

Property Value

PhDim_t

The PhDim_t that represents the width and height, in pixels, of this image.

See also

◆ Width

const unsigned short PhWidgets::Drawing::Image::Width

Gets the width, in pixels, of this Image.

Property Value

unsigned short

The width, in pixels, of this Image.

See also

The documentation for this class was generated from the following file: