blip  0.1
DisplayMetrics Class Reference

A utility object with methods for converting between pixel units based on a given screen density. More...

#include <DisplayMetrics.hpp>

Public Member Functions

 DisplayMetrics (ScreenDensity density=ScreenDensity_Default) throw ()
 Construct a new DisplayMetrics object for the given screen density. More...
 
 ~DisplayMetrics () throw ()
 Destructor. More...
 
int dipToPixels (int dip) const throw ()
 Convert device-independent pixels to physical pixels. More...
 
int pointsToPixels (int points) const throw ()
 Convert points to physical pixels. More...
 
ScreenDensity getScreenDensity () const throw ()
 Get the screen density. More...
 

Static Public Attributes

static const int DEFAULT_DENSITY = 160
 The reference density. More...
 

Detailed Description

A utility object with methods for converting between pixel units based on a given screen density.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ DisplayMetrics()

Construct a new DisplayMetrics object for the given screen density.

◆ ~DisplayMetrics()

~DisplayMetrics ( )
throw (
)

Destructor.

Member Function Documentation

◆ dipToPixels()

int dipToPixels ( int  dip) const
throw (
)

Convert device-independent pixels to physical pixels.

◆ getScreenDensity()

ScreenDensity getScreenDensity ( ) const
throw (
)
inline

Get the screen density.

◆ pointsToPixels()

int pointsToPixels ( int  points) const
throw (
)

Convert points to physical pixels.

Member Data Documentation

◆ DEFAULT_DENSITY

const int DEFAULT_DENSITY = 160
static

The reference density.

(160 dpi).


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