Thumbnail Classes
Many Windows applications like Microsoft PowerPoint and Delrina WinFax support thumb
Example Thumbnail
A snapshot of the current view is stored at the beginning of the archive file when the document is serialized. A specialized File Open dialog displays the stored image of highlighted files to aid in file selection.
The thumbnail classes are designed to display the special images stored in archive files. They cannot be used to display images from other file formats.
On this page:
The Thumbnail Classes
The followi
Thumbnail Class Hierarchy
SECTNBitmap
SECTNBitmap is a CBitmap
SECTNDC
SECTNDC is a CDC derivative that is paOnDraw() method. The view draws the thumbnail image onto the SECTNDC. Objective Toolkit converts the image to an SECTNBitmap and then saves the image.
SECTNDocument
Class SECTNDocument is an optional CDocument d
SECTNFileDialog
SECTNFileDialog uses a CFileDialog derivative to display a thumbnail. SECTNFileDialog also automatically reads and displays the thumbnail image when the user clicks a file name in the dial
SECTNView
SECTNView is a CView derivative that can automati
SECTNWinApp
SECTNWinApp automatically cr
Using the Thumbnail Classes
To enable thumbnails in your application:
1. Replace your application object’s ba
2. Change your CView-derived class to derive from SECTNView. Add any custom thumbnail code to this class.
3. Change your CDocument derivative to derive from SECTNDocument. Be sure to call SECTNDocument::Serialize() first in your ::Serialize() method.
By default SECTNView generates a thumbnail that is the size of your entire view. SECTNView cannot infer how you want your view’s thumbnail to appear, so you need to write special thumbnail-generating code.
To generate custom thumbnails:
4. Derive a class from SECTNView and override the OnDraw() method.
5. In the OnDraw() override, you can determine if a thumbnail is being drawn by calling IsThumbNailing(). If the view is a thumbnail, draw the view’s thumbnail on the specified DC.
Thumbnail Sample
The Objective Toolkitthumbnl sample (Samples\Toolkit\MFC\UIExt\thumbnl) demonstrates the MFC scribble tutor