FormatJpeg.cpp
Upload User: hbtiangong
Upload Date: 2009-03-29
Package Size: 255k
Code Size: 2k
Category:

Windows Develop

Development Platform:

Visual C++

  1. // FormatJpeg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "rwjpegexp.h"
  5. #include "FormatJpeg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CFormatJpeg dialog
  13. CFormatJpeg::CFormatJpeg(CWnd* pParent /*=NULL*/)
  14. : CDialog(CFormatJpeg::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(CFormatJpeg)
  17. m_nQuality = 75;
  18. m_strQuality = _T("75");
  19. //}}AFX_DATA_INIT
  20. m_bColor=TRUE;
  21. }
  22. void CFormatJpeg::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(CFormatJpeg)
  26. DDX_Control(pDX, IDC_SLIDER1, m_Quality);
  27. DDX_Slider(pDX, IDC_SLIDER1, m_nQuality);
  28. DDX_Text(pDX, IDC_VALUE, m_strQuality);
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(CFormatJpeg, CDialog)
  32. //{{AFX_MSG_MAP(CFormatJpeg)
  33. ON_WM_HSCROLL()
  34. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  35. ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
  36. //}}AFX_MSG_MAP
  37. END_MESSAGE_MAP()
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CFormatJpeg message handlers
  40. BOOL CFormatJpeg::OnInitDialog() 
  41. {
  42. CDialog::OnInitDialog();
  43. // TODO: Add extra initialization here
  44. m_Quality.SetRange(0, 100, TRUE);
  45. m_strQuality.Format("%d", m_nQuality);
  46. UpdateData(FALSE);
  47. ((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(m_bColor);
  48. ((CButton *)GetDlgItem(IDC_RADIO2))->SetCheck(! m_bColor);
  49. return TRUE;  // return TRUE unless you set the focus to a control
  50.               // EXCEPTION: OCX Property Pages should return FALSE
  51. }
  52. void CFormatJpeg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
  53. {
  54. // TODO: Add your message handler code here and/or call default
  55. UpdateData();
  56. m_strQuality.Format("%d", m_nQuality);
  57. UpdateData(FALSE);
  58. CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
  59. }
  60. void CFormatJpeg::OnRadio1() 
  61. {
  62. // TODO: Add your control notification handler code here
  63. m_bColor=TRUE;
  64. }
  65. void CFormatJpeg::OnRadio2() 
  66. {
  67. // TODO: Add your control notification handler code here
  68. m_bColor=FALSE;
  69. }