CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
CFxUIPixmap Class Reference

#include <FxUIPixmap.h>

Inheritance diagram for CFxUIPixmap:
CFxUIPaintDevice

Public Types

enum  AspectRatioMode { IgnoreAspectRatio , KeepAspectRatio , KeepAspectRatioByExpanding }
 
enum  TransformationMode { FastTransformation , SmoothTransformation }
 

Public Member Functions

 CFxUIPixmap ()
 
 CFxUIPixmap (int width, int height)
 
 CFxUIPixmap (const CFxUIString &fileName)
 
 CFxUIPixmap (const CFxUIPixmap &pixmap)
 
 CFxUIPixmap (const FxNativePixmap &pixmap)
 
 ~CFxUIPixmap ()
 
CFxUIPixmapoperator= (const CFxUIPixmap &pixmap)
 
 operator FxNativePixmap & () const
 
void fill (const CFxUIColor &color=FxUIGlobalColor::white)
 
bool loadFromData (const CFxUIByteArray &data)
 
bool load (const CFxUIString &fileName)
 
bool save (const CFxUIString &fileName, const char *format=nullptr, int quality=-1) const
 
CFxUIPixmap scaled (int width, int height, AspectRatioMode aspectRatioMode=IgnoreAspectRatio, TransformationMode transformMode=FastTransformation) const
 
CFxUIPixmap scaledToWidth (int width, TransformationMode mode=FastTransformation) const
 
CFxUIImage toImage () const
 
void setUrl (const CFxUIString &url)
 
CFxUIString url () const
 
int width ()
 
CFxUISize size ()
 
bool isNull ()
 
- Public Member Functions inherited from CFxUIPaintDevice
 CFxUIPaintDevice (FxNativePaintDevice *paintDevice=nullptr)
 
 ~CFxUIPaintDevice ()
 
 operator FxNativePaintDevice * () const
 

Protected Attributes

CFxUIPixmapImpl * m_pImpl = nullptr
 
- Protected Attributes inherited from CFxUIPaintDevice
CFxUIPaintDeviceImpl * m_pPaintDeviceImpl = nullptr
 

Detailed Description

Definition at line 45 of file FxUIPixmap.h.

Member Enumeration Documentation

◆ AspectRatioMode

Enumerator
IgnoreAspectRatio 
KeepAspectRatio 
KeepAspectRatioByExpanding 

Definition at line 48 of file FxUIPixmap.h.

◆ TransformationMode

Enumerator
FastTransformation 
SmoothTransformation 

Definition at line 55 of file FxUIPixmap.h.

Constructor & Destructor Documentation

◆ CFxUIPixmap() [1/5]

CFxUIPixmap::CFxUIPixmap ( )

Constructors

◆ CFxUIPixmap() [2/5]

CFxUIPixmap::CFxUIPixmap ( int width,
int height )

Parameterized Constructor

◆ CFxUIPixmap() [3/5]

CFxUIPixmap::CFxUIPixmap ( const CFxUIString & fileName)

◆ CFxUIPixmap() [4/5]

CFxUIPixmap::CFxUIPixmap ( const CFxUIPixmap & pixmap)

Copy Constructor

◆ CFxUIPixmap() [5/5]

CFxUIPixmap::CFxUIPixmap ( const FxNativePixmap & pixmap)

◆ ~CFxUIPixmap()

CFxUIPixmap::~CFxUIPixmap ( )

Destructor

Member Function Documentation

◆ fill()

void CFxUIPixmap::fill ( const CFxUIColor & color = FxUIGlobalColor::white)

Fills the pixmap with the given color.

Parameters
CFxUIPalette::FxUIColorGroup

◆ isNull()

bool CFxUIPixmap::isNull ( )

Returns true if this is a null pixmap; otherwise returns false.

Returns
bool

◆ load()

bool CFxUIPixmap::load ( const CFxUIString & fileName)

Loads a pixmap from the file with the given fileName. Returns true if the pixmap was successfully loaded, otherwise invalidates the pixmap and returns false.

Parameters
filenameas CFxUIString
Returns
bool

◆ loadFromData()

bool CFxUIPixmap::loadFromData ( const CFxUIByteArray & data)

Loads a pixmap from the given binary data. Returns true if the pixmap was loaded successfully, otherwise invalidates the pixmap and returns false.

Parameters
binarydata as CFxUIByteArray
Returns
bool

◆ operator FxNativePixmap &()

CFxUIPixmap::operator FxNativePixmap & ( ) const

◆ operator=()

CFxUIPixmap & CFxUIPixmap::operator= ( const CFxUIPixmap & pixmap)

Assignment operator

◆ save()

bool CFxUIPixmap::save ( const CFxUIString & fileName,
const char * format = nullptr,
int quality = -1 ) const

Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns true if successful, otherwise returns false.

Parameters
filenameas CFxUIString
imagefile format
qualityfactor
Returns
bool

◆ scaled()

CFxUIPixmap CFxUIPixmap::scaled ( int width,
int height,
AspectRatioMode aspectRatioMode = IgnoreAspectRatio,
TransformationMode transformMode = FastTransformation ) const

Returns a copy of the pixmap scaled to a rectangle with the given width and height according to the given aspectRatioMode and transformMode.

Parameters
width
height
CFxUIPixmap::AspectRatioMode
CFxUIPixmap::TransformationMode
Returns
CFxUIPixmap

◆ scaledToWidth()

CFxUIPixmap CFxUIPixmap::scaledToWidth ( int width,
TransformationMode mode = FastTransformation ) const

Returns a scaled copy of the image. The returned image is scaled to the given width using the specified transformation mode.

Parameters
width
CFxUIPixmap::TransformationMode
Returns
CFxUIPixmap

◆ setUrl()

void CFxUIPixmap::setUrl ( const CFxUIString & url)

Set link URL.

Parameters
urlas CFxUIString

◆ size()

CFxUISize CFxUIPixmap::size ( )

Returns the size of the pixmap.

Returns
CFxUISize

◆ toImage()

CFxUIImage CFxUIPixmap::toImage ( ) const

Converts the pixmap to a CFxUIImage. Returns a null image if the conversion fails.

Returns
CFxUIImage

◆ url()

CFxUIString CFxUIPixmap::url ( ) const

Returns the link URL.

Returns
CFxUIString

◆ width()

int CFxUIPixmap::width ( )

Returns the width of the pixmap.

Returns
int

Member Data Documentation

◆ m_pImpl

CFxUIPixmapImpl* CFxUIPixmap::m_pImpl = nullptr
protected

Definition at line 189 of file FxUIPixmap.h.


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