The SimpleImage sample shows how to use the
| Security Note |
|---|
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. |
Building and Running the Sample
To build and run the SimpleImage sample
Open the solution SimpleImage.sln.
On the Build menu, click Build.
On the Debug menu, click Start Without Debugging.
The sample is a simple application that allows you to do the following:
Load an image from disk in a variety of formats.
Resize the image and convert it from color to grayscale.
Save the image in several image formats.
Classes and Keywords
This sample demonstrates the following classes:
CImage, CString, CPaintDC, CDialog, CFileDialog, CToolBar, CStatic
This sample demonstrates the following keywords:
CToolBar::SetButtonInfo, CToolBar::SetButtons, CToolBar::LoadToolBar, CToolBar::EnableDocking, CImage::GetWidth, CImage::GetHeight, CImage::StretchBlt, CImage::GetExporterFilterSting, CImage::Load, CImage::Save, CImage::IsIndexed, CImage::GetPixel, CImage::SetPixelRGB, CImage::GetMaxColorTableEntries, CImage::GetColorTable, CImage::IsNull, CImage::GetBPP, CImage::IsDIBSection, CImage::GetPitch, CCmdUI::Enable, CCmdUI::SetCheck, CStatic::SendMessage, CWnd::GetClientRect, CWnd::GetDlgItem, sprintf