Click here to Skip to main content
15,884,176 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 117.6K   51.5K   405  
An article on a library for image manipulation
#pragma once

//-------------------------------------------------------------------------------------
class DlgSaveImage : public CFileDialog
{
    enum
    {
        IDC_USE_32_BPP = 1250,

        IDC_QUALITY_TITLE = 1260,
        IDC_QUALITY_SLIDER = 1261,
        IDC_QUALITY_VALUE = 1262,

        IDC_KEEP_EXIF = 1270,
    };

    static CString QueryLanguageText (int nID)
    {
        return theApp.GetText (L"IDD_SAVE_IMAGE", nID) ;
    }

public:
	DlgSaveImage (LPCTSTR strInitFile) ;

    BOOL IsKeepEXIF() {return m_keep_EXIF;}
    int GetBPP() ;
    int GetQuality() ;

private:
    enum IMG_INDEX
    {
        IMG_INDEX_BMP = 1,
        IMG_INDEX_JPG = 2,
        IMG_INDEX_GIF = 3,
        IMG_INDEX_PNG = 4,
        IMG_INDEX_TIF = 5,
    };

private:
    TCHAR   m_DefExt[32] ;
    BOOL    m_keep_EXIF ;
    BOOL    m_32bpp ;
    int     m_quality ;

    static int        g_last_quality ;
    static IMG_INDEX  g_last_img_index ;

    static CString GetFileExt (IMG_INDEX nType) ;
    void SetQualityValue() ;

    virtual BOOL OnInitDialog() ;
    virtual void OnTypeChange() ;
    virtual BOOL OnFileNameOK() ;

    afx_msg void OnUse32BPP();
    afx_msg void OnEXIF();
    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