Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cSurfaceIcon Class Reference

#include <cSurfaceIcon.h>

Public Member Functions

 cSurfaceIcon (bool bCursor=false) noexcept
 
 ~cSurfaceIcon ()
 
bool isValid () const noexcept
 
PIXELS_t get_Width () const noexcept
 
PIXELS_t get_Height () const noexcept
 
size_t get_SizeImage () const
 
bool SetScaleIcon (const cSurfaceIcon &src, float fx, float fy)
 
bool DrawIconX (cSurfaceBase &dst, PIXELS_t dx, PIXELS_t dy)
 
HRESULT ReadStream1 (cStreamInput &file, int nIconIndex=0)
 
HRESULT WriteStream1 (cStreamOutput *pFile) const
 
 UNITTEST_FRIEND (cSurfaceIcon)
 

Static Public Member Functions

static HRESULT GRAYCALL ReadStreamAll (cStreamInput &file, OUT cArrayNew< cSurfaceIcon > &a)
 
static HRESULT GRAYCALL WriteStreamAll (cStreamOutput *pFile, const cArrayNew< cSurfaceIcon > &a)
 

Public Attributes

bool m_bCursor
 The m_ptHotspot is set/used. More...
 
cPoint2i m_ptHotspot
 m_bCursor support this but Icons do not. PIXELS_t More...
 
cSurface m_SurfMask
 AND mask image. More...
 
cSurface m_SurfColor
 XOR mask image. More...
 

Protected Member Functions

HRESULT ReadStreamNH (cStreamInput &stmIn)
 

Static Protected Member Functions

static HRESULT GRAYCALL ReadStreamH (cStreamInput &stmIn, OUT tagICONDIR &icondir)
 

Detailed Description

Support for a single LOD from an ICO file format. (Cursors are the same as icons) http://en.wikipedia.org/wiki/ICO_%28file_format%29

Constructor & Destructor Documentation

◆ cSurfaceIcon()

GrayLib::cSurfaceIcon::cSurfaceIcon ( bool  bCursor = false)
noexcept

◆ ~cSurfaceIcon()

GrayLib::cSurfaceIcon::~cSurfaceIcon ( )

Member Function Documentation

◆ DrawIconX()

bool GrayLib::cSurfaceIcon::DrawIconX ( cSurfaceBase dst,
PIXELS_t  dx,
PIXELS_t  dy 
)

Draw the icon to the surface. Draw m_SurfMask and possibly m_SurfColor. like _WIN32 DrawIconEx()

Note
name "DrawIcon" is "#define" in UNDER_CE

◆ get_Height()

PIXELS_t GrayLib::cSurfaceIcon::get_Height ( void  ) const
inlinenoexcept

height in pixels not bytes.

◆ get_SizeImage()

size_t GrayLib::cSurfaceIcon::get_SizeImage ( ) const

◆ get_Width()

PIXELS_t GrayLib::cSurfaceIcon::get_Width ( void  ) const
inlinenoexcept

width in pixels not bytes.

◆ isValid()

bool GrayLib::cSurfaceIcon::isValid ( ) const
inlinenoexcept

◆ ReadStream1()

HRESULT GrayLib::cSurfaceIcon::ReadStream1 ( cStreamInput file,
int  nIconIndex = 0 
)

Read Just a single LODs of a MIME_EXT_ico file. similar to _WIN32 LoadImage() or maybe LoadIcon()

Note
may contain multiple icons of various sizes ??

◆ ReadStreamAll()

HRESULT GRAYCALL GrayLib::cSurfaceIcon::ReadStreamAll ( cStreamInput file,
OUT cArrayNew< cSurfaceIcon > &  a 
)
static

◆ ReadStreamH()

HRESULT GRAYCALL GrayLib::cSurfaceIcon::ReadStreamH ( cStreamInput stmIn,
OUT tagICONDIR icondir 
)
staticprotected

◆ ReadStreamNH()

HRESULT GrayLib::cSurfaceIcon::ReadStreamNH ( cStreamInput stmIn)
protected

◆ SetScaleIcon()

bool GrayLib::cSurfaceIcon::SetScaleIcon ( const cSurfaceIcon src,
float  fx,
float  fy 
)

Set this icon as a scaled version of some other icon. ASSUME fx != 1 || fy != 1

◆ UNITTEST_FRIEND()

GrayLib::cSurfaceIcon::UNITTEST_FRIEND ( cSurfaceIcon  )

◆ WriteStream1()

HRESULT GrayLib::cSurfaceIcon::WriteStream1 ( cStreamOutput pFile) const
Todo:
Write MIME_EXT_ico file.

◆ WriteStreamAll()

HRESULT GRAYCALL GrayLib::cSurfaceIcon::WriteStreamAll ( cStreamOutput pFile,
const cArrayNew< cSurfaceIcon > &  a 
)
static

Member Data Documentation

◆ m_bCursor

bool GrayLib::cSurfaceIcon::m_bCursor

The m_ptHotspot is set/used.

◆ m_ptHotspot

cPoint2i GrayLib::cSurfaceIcon::m_ptHotspot

m_bCursor support this but Icons do not. PIXELS_t

◆ m_SurfColor

cSurface GrayLib::cSurfaceIcon::m_SurfColor

XOR mask image.

◆ m_SurfMask

cSurface GrayLib::cSurfaceIcon::m_SurfMask

AND mask image.


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