This article describes a sample
with the same funcionality as the known DIBLOOK
MFC sample,
but enhanced in some ways. The main (new) features of this
new sample are:
- The sample
is now completely object oriented, there are no global
functions
- The standard file
open dialog has been changed to a new
(derived from standard) file
dialog with preview
- The palette treatment
has been improved so the palette is not realized twice
for the active image (the first in foregroud the
second in background)
The sample
also demonstrates some programming techniques:
- Changing the standard file
open in doc/view MFC
architecture
- Modifiyng standard
dialogs without using new hook functions (or what's
the same: using the MFC
hook functions)
- Correct palette
treatment
- Subclassing controls
Several new classes were
added to the original DIBLOOK
sample:
- The dib api provided
as a set of global functions was encapsulated in a
CDib class (described in an article in the bitmaps
& palettes section)
- A static control
descendant that displays an image (described in an
article in the static control section)
- A descendant from
CFileDialog to implement the
file open dialog with preview
(described in an article in the dialogs section)
- A descendant from
CDocManager needed to change the default MFC
file open dialog (described in an article
in the doc-view section)
Download
Source Code