Software DIY, to put it bluntly, is to use existing class libraries and components to quickly construct their own programs
. Just like finding all kinds of computer accessories and assembling them into a whole machine;
In the same place, computer accessories, even the old second-hand accessories, have to spend a little money, and software
You can get the class libraries and components for free sometimes.
WantDIY is a simple and practical image browser. As we all know, ACDSee is the most popular
The image browser is really good.
DIY made such an image browser, which is simple, practical, and exquisite:
SimpleBrowse.
Step 1: set specifications
1. Like ACDSee, the directory tree on the left and the file list on the right show the thumbnail of the image file.
2. Reduce the image to be nice-looking, fast to browse, and more formats to browse.
3. It is concise and practical, and should not be too difficult to create.
4. It can be used in Win98 and WinNT.
Step 2: select materials
The interface is mainly divided into two parts: the directory tree on the left and the file list on the right.
If the two items are large.
1. Left directory tree
SlaveHttp://www.codejockeys.com/kstowell/, we can get a free mfcextension
Exhibition class libraryCJ60Lib. dll. This class library contains many classes for interface design.
CShellTree class, which can display the same effect as the directory tree on the left of Windows Explorer.
Select the desired one.
2. File List on the right
This is a key part. It requires you to be able to create, display, and manage thumbnail images of image files. You must be able to browse more images.
Image files in different formats, requiring more refined thumbnail display and faster browsing speed, requiring easy
Is difficult to use. Tailai Image Technology Co., Ltd. has a deep understanding in image processing application software development.
And launchedMFC extension class library thl. dll, which has a CThumbListCtrl class
It is used to create and display image thumbnails. It is selected fromHttp://www.thalia.com.cn.
---- Step 3: generate a program framework
---- Like developing other programs, use VC ++ 6.0 AppWizard to generate the program framework.
---- 1. Choose "File"> "New", go to the Projects panel, and select "MFC AppWizard (exe ),
The Project name is SimpleBrowse. OK, and then enter a wizard. There are 6 steps in total.
---- 2. Step 1: select single document. If other parameters are left blank, use the default value.
---- 3. Step 2 of 6. Do not move. Use the default value.
---- 4. Step 3 of 6. Do not move. Use the default value.
---- 5. Step 4 of 6: Select Internet Explorer ReBars. Use the default value.
---- 6. Step 5 of 6. Select Windows Explorer. If the other parameters are left blank, use the default value.
---- 7. Step 6 of 6, do not move, use the default value. After finishing the confirmation, the program framework is generated.
---- Step 4: Use class libraries and components
---- 1. The class corresponding to the directory tree on the left is CLeftView.
Class CLeftView: public CView/* CTreeView */
{
...
// Attributes
Public:
CShellTree m_TreeCtrl; // use shell tree control
...
// Generated message map functions
Protected:
// {AFX_MSG (CLeftView)
Afx_msg int OnCreate (maid );
Afx_msg void OnSize (UINT nType, int cx, int cy );
Afx_msg void OnItemexpanding (NMHDR * pNMHDR, LRESULT * pResult );
Afx_msg void OnSelchanged (NMHDR * pNMHDR, LRESULT * pResult );
//} AFX_MSG
DECLARE_MESSAGE_MAP ()
...
};
---- (1) change its parent class from CTreeView to CView. The reason is described later.
---- (2) the member variable m_TreeCtrl added to the CShellTree class is implemented by the directory tree.
---- (3) Add the message response function OnCreate (), where m_TreeCtrl is created