Download source files - 25 Kb
Download demo application - 14 Kb
It is often important to MFC programmers to speed up the Print Preview display within their Document/View application.
I would like to present some of my improvements as to the Preview procedure of printing that I experienced during my recent developpment of a large system. I extended the MFC Preview procedure to create a flicker free system using the BitBlt
function.
You can see an outline of the ExtPreviewView
class definition below. This class is derived from MFCs CPreviewView
described in MFC Technical Note 30.
The three protected members save virtual viewport data.
Through the initialization of the MFC Preview procedure, the InitVxPrintOffset()
function is exectued once and sets the values of the members mentioned above.
Therefore you are able to create a Bitmap on memory DC which is compatible with the Preview DC in MFC for high-speed drawing, using the maximum size of the virtual paper.
class ExtPreviewView : public CPreviewView
{
...
protected:
CSize m_VxPrintOffset;
CSize m_sizeVxVpExt, m_sizeVxWinExt;
public:
void InitVxPrintOffset(CDC* pDC);
...
friend class CAdvancedPreviewView;
};
Second I add some more zoom-in lebels to the MFC as following.
#define ZOOM_IN_150 3
#define ZOOM_IN_200 4
#define ZOOM_IN_400 5
I add some codes to such as SetScaleSize() function and others.
Note
You need to set a special path for "gafximpl.h" in your work space. The path must be set same as source path of MFC class library
This is how you do this:
- On the Project menu, click Settings.
- In the Settings dialog box, select the C/C++ tab.
- Select Preprocessor from the Category drop-down list.
- The project-specific include paths are located in the Additional include directories edit box.
Thank you.
Yasuhiko Yoshimura
September/05/2000