Operator Console
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
CStaticBmp Class Reference

A class used to hold a bitmap image for display. More...

#include <StaticBmp.h>

Inheritance diagram for CStaticBmp:
[legend]

Public Member Functions

 CStaticBmp (void)
 
 ~CStaticBmp (void)
 
void Draw (const CWnd *parent)
 
bool Init ()
 
void Update (void *buf)
 
 CStaticBmp (void)
 
 ~CStaticBmp (void)
 
void Draw (const CWnd *parent)
 
bool Init ()
 
void Update (void *buf)
 

Protected Attributes

CDC m_cdc
 memory drawing context to hold image More...
 
CBitmap m_bmp
 bitmap for m_cdc More...
 
int m_width
 
int m_height
 
void * m_buf
 

Detailed Description

A class used to hold a bitmap image for display.

Constructor & Destructor Documentation

CStaticBmp::CStaticBmp ( void  )

References m_buf, m_height, and m_width.

24 {
25  m_buf = NULL;
26  m_width = 0;
27  m_height = 0;
28 }
void * m_buf
Definition: StaticBmp.h:40
int m_width
Definition: StaticBmp.h:38
int m_height
Definition: StaticBmp.h:39
CStaticBmp::~CStaticBmp ( void  )
31 {
32 }
CStaticBmp::CStaticBmp ( void  )
CStaticBmp::~CStaticBmp ( void  )

Member Function Documentation

void CStaticBmp::Draw ( const CWnd *  parent)

References m_bmp, m_buf, m_cdc, m_height, and m_width.

Referenced by COperatorConsoleDlg::DrawImage().

67 {
68  CRect rect;
69  DWORD numBytes = m_width * m_height * 4;
70 
71  GetWindowRect(&rect);
72  parent->ScreenToClient(&rect);
73  m_bmp.SetBitmapBits(numBytes, m_buf);
74  CDC *cdc = GetDC();
75 
76  cdc->BitBlt(rect.left, rect.top, m_width, m_height, &m_cdc, 0, 0, SRCCOPY);
77 
78 }
void * m_buf
Definition: StaticBmp.h:40
int m_width
Definition: StaticBmp.h:38
CDC m_cdc
memory drawing context to hold image
Definition: StaticBmp.h:36
int m_height
Definition: StaticBmp.h:39
CBitmap m_bmp
bitmap for m_cdc
Definition: StaticBmp.h:37

Here is the caller graph for this function:

void CStaticBmp::Draw ( const CWnd *  parent)
bool CStaticBmp::Init ( )
bool CStaticBmp::Init ( )

References m_bmp, m_cdc, m_height, and m_width.

Referenced by COperatorConsoleDlg::ReInitDialog().

35 {
36  CDC *cdc = GetDC();
37  CRect rect;
38  bool success;
39 
40 
41  //
42  // Create a memory drawing context and bitmap the size of the window
43  //
44  GetWindowRect(&rect);
45  m_width = rect.Width();
46  m_height = rect.Height();
47 
48  if (m_cdc.CreateCompatibleDC(cdc))
49  {
50  if (m_bmp.CreateCompatibleBitmap(cdc, m_width, m_height))
51  {
52  m_cdc.SelectObject(&m_bmp);
53  success = true;
54  }
55  }
56 
57  return success;
58 }
int m_width
Definition: StaticBmp.h:38
CDC m_cdc
memory drawing context to hold image
Definition: StaticBmp.h:36
int m_height
Definition: StaticBmp.h:39
CBitmap m_bmp
bitmap for m_cdc
Definition: StaticBmp.h:37

Here is the caller graph for this function:

void CStaticBmp::Update ( void *  buf)

References m_buf.

Referenced by COperatorConsoleDlg::ReInitDialog(), and COperatorConsoleDlg::UpdateImage().

61 {
62  m_buf = buf;
63  Invalidate();
64 }
void * m_buf
Definition: StaticBmp.h:40

Here is the caller graph for this function:

void CStaticBmp::Update ( void *  buf)

Member Data Documentation

CBitmap CStaticBmp::m_bmp
protected

bitmap for m_cdc

Referenced by Draw(), and Init().

void * CStaticBmp::m_buf
protected

Referenced by CStaticBmp(), Draw(), and Update().

CDC CStaticBmp::m_cdc
protected

memory drawing context to hold image

Referenced by Draw(), and Init().

int CStaticBmp::m_height
protected

Referenced by CStaticBmp(), Draw(), and Init().

int CStaticBmp::m_width
protected

Referenced by CStaticBmp(), Draw(), and Init().


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