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

CxImage

Rate me:
Please Sign up or sign in to vote.
4.65/5 (949 votes)
15 Feb 2008Zlib13 min read 12.9M   300.6K   1.6K  
CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
// DlgText.cpp : implementation file
//

#include "stdafx.h"
#include "demo.h"
#include "DlgText.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// DlgText dialog


DlgText::DlgText(CWnd* pParent /*=NULL*/)
	: CDialog(DlgText::IDD, pParent)
{
	//{{AFX_DATA_INIT(DlgText)
	m_text = _T("");
	//}}AFX_DATA_INIT
	memset(&m_font,0,sizeof(m_font));
}


void DlgText::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DlgText)
	DDX_Control(pDX, IDOK, m_ok);
	DDX_Control(pDX, IDCANCEL, m_canc);
	DDX_Control(pDX, ID_FONT, m_bfont);
	DDX_Text(pDX, IDC_EDIT1, m_text);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DlgText, CDialog)
	//{{AFX_MSG_MAP(DlgText)
	ON_BN_CLICKED(ID_FONT, OnFont)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DlgText message handlers

BOOL DlgText::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_ok.SetIcon(IDI_G,BS_LEFT);
	m_canc.SetIcon(IDI_R,BS_LEFT);
	m_bfont.SetIcon(IDI_B,BS_LEFT);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void DlgText::OnFont() 
{
	CFontDialog	dlg;
	memcpy(dlg.m_cf.lpLogFont, &m_font, sizeof(m_font));
	dlg.m_cf.rgbColors = m_color;
	if (dlg.DoModal()==IDOK){
		memcpy(&m_font,dlg.m_cf.lpLogFont, sizeof(m_font));
		m_color = dlg.GetColor();
	}
}

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 zlib/libpng License


Written By
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions