DropSizeDLG.cpp
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:2k
- // DropSizeDLG.cpp : implementation file
- //
- #include "stdafx.h"
- #include "tiffsample.h"
- #include "DropSizeDLG.h"
- #include "TIFFDoc.h"
- #include "TIFFView.h"
- extern TIFFView * g_view;
- /////////////////////////////////////////////////////////////////////////////
- // DropSizeDLG dialog
- DropSizeDLG::DropSizeDLG(CWnd* pParent /*=NULL*/)
- {
- //{{AFX_DATA_INIT(DropSizeDLG)
- //}}AFX_DATA_INIT
- //CDialogBar::Create(pParent, IDD_DROPSIZE_DLG, CBRS_TOP, IDD_DROPSIZE_DLG);
- }
- void DropSizeDLG::DoDataExchange(CDataExchange* pDX)
- {
- CDialogBar::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(DropSizeDLG)
- DDX_Control(pDX, IDC_IMGSIZE_COMBO, m_sizeCombo);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(DropSizeDLG, CDialogBar)
- //{{AFX_MSG_MAP(DropSizeDLG)
- ON_WM_SIZE()
- ON_WM_SHOWWINDOW()
- ON_CBN_SELCHANGE(IDC_IMGSIZE_COMBO, OnChangeScale)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // DropSizeDLG message handlers
- void DropSizeDLG::OnSize(UINT nType, int cx, int cy)
- {
- CDialogBar::OnSize(nType, cx, cy);
- }
- void DropSizeDLG::Setup(void)
- {
- }
- void DropSizeDLG::OnShowWindow(BOOL bShow, UINT nStatus)
- {
- CDialogBar::OnShowWindow(bShow, nStatus);
- CComboBox * pCombo = (CComboBox *)GetDlgItem(IDC_IMGSIZE_COMBO);
- if (pCombo)
- {
- pCombo->SetCurSel(8);
- }
- }
- void DropSizeDLG::OnChangeScale()
- {
- const double scales[] = { 0.10, 0.20, 0.25, 0.33, 0.50, 0.67,
- 0.75, 0.90, 1.00, 1.25, 1.33, 1.50, 1.67, 1.75, 2.0, 3.0, 4.0};
- CComboBox * pCombo = (CComboBox *)GetDlgItem(IDC_IMGSIZE_COMBO);
- if (pCombo)
- {
- int sel = pCombo->GetCurSel();
- if (sel != CB_ERR)
- {
- g_view->StretchImage(scales[sel]);
- }
- }
- }