Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / MFC

Rendering Text on Top of a Bitmap

Rate me:
Please Sign up or sign in to vote.
3.23/5 (22 votes)
1 Aug 2008CPOL2 min read 72.6K   1.2K   25  
Rendering text on top of a bitmap
// GDITestView.h : interface of the CGDITestView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_GDITESTVIEW_H__B57D5A5D_FD9A_4A59_A226_2309C7171A39__INCLUDED_)
#define AFX_GDITESTVIEW_H__B57D5A5D_FD9A_4A59_A226_2309C7171A39__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CGDITestView : public CScrollView
{
protected: // create from serialization only
	CGDITestView();
	DECLARE_DYNCREATE(CGDITestView)

// Attributes
public:
	CGDITestDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGDITestView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate();
	virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CGDITestView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CGDITestView)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
	
private:
    CFont   m_Font;
    int     m_nBmpWidth;
    int     m_nBmpHeight;
};

#ifndef _DEBUG  // debug version in GDITestView.cpp
inline CGDITestDoc* CGDITestView::GetDocument()
   { return (CGDITestDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GDITESTVIEW_H__B57D5A5D_FD9A_4A59_A226_2309C7171A39__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Pinnacle Business Systems
United States United States

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

HTTP 404 - File not found
Internet Information Services

Comments and Discussions