Click here to Skip to main content
15,895,799 members
Articles / Desktop Programming / MFC

ImageStone - A Powerful C++ Class Library for Image Manipulation

Rate me:
Please Sign up or sign in to vote.
4.81/5 (250 votes)
6 Dec 2011Zlib3 min read 120.6K   51.5K   405  
An article on a library for image manipulation
#pragma once

//-------------------------------------------------------------------------------------
// language support with auto set TITLE, IDOK, IDCANCEL
// slider info bind
class DlgModalBase : public CDialog
{
    struct SLIDER_INFO
    {
        int   m_name_id ;
        int   m_slider_id ;
        int   m_value_id ;
        int   m_min ;
        int   m_max ;
        int   m_current ;
        int   m_name_text ;
    };

public:
    DlgModalBase (LPCWSTR strSection) : m_section(strSection), m_title_menu_cmd(0) {}
    DlgModalBase (LPCWSTR strSection, UINT nDialogID) : CDialog(nDialogID, NULL), m_section(strSection), m_title_menu_cmd(0) {}

    void SetSlider_1 (int nMin, int nMax, int nInit, int nNameText) ;
    void SetSlider_2 (int nMin, int nMax, int nInit, int nNameText) ;
    void SetSlider_3 (int nMin, int nMax, int nInit, int nNameText) ;

    int GetSlider_1() {return GetSlider_n(1);}
    int GetSlider_2() {return GetSlider_n(2);}
    int GetSlider_3() {return GetSlider_n(3);}

    void SetTitleFromMenu (int nMenuCommand) {m_title_menu_cmd=nMenuCommand;}

protected:
    CString QueryLanguageText (int nTextID) const ;

    void SetControlText (int nCtrlID, int nTextID)
    {
        SetDlgItemText(nCtrlID, QueryLanguageText(nTextID)) ;
    }

private:
    CString   m_section ;
    std::deque<SLIDER_INFO>   m_slider ;
    int   m_title_menu_cmd ;

    int GetSlider_n (size_t n) ;

protected:
    virtual BOOL OnInitDialog() ;
    virtual void DoDataExchange(CDataExchange* pDX) ;

    afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	DECLARE_MESSAGE_MAP()
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The zlib/libpng License


Written By
Team Leader PhoXo
China China
graduate from University of Science and Technology of China at 2002.

Now I work at www.phoxo.com.

Comments and Discussions