/*[]=====================================================================[]*/ /*[] LEADTOOLS for Windows(Class Library) - Version 11 []*/ /*[] []*/ /*[] []*/ /*[] Copyright (c) 1991-2000 LEAD Technologies, Inc. []*/ /*[] All Rights Reserved. []*/ /*[]=====================================================================[]*/ /*------(Dimens)--------------------------------------------------------------- We have made the assumption that the user has the knowledge of Object Oriented programing of C under Windows. This example will: 1. load the image from a file, 2. The DIMENSION structure is used with the LFile::ReadLoadResolutions function, which tests for available resolutions in a specified PhotoCD or FlashPix file. 3. Using Dialogbox to choose the resolutions to display the image depend which resolution you choosed. Usage: Dimens ----------------------------------------------------------------------------------*/ // dimView.cpp : implementation of the CDimView class // #include "stdafx.h" #include "dimens.h" #include "dimensDc.h" #include "dimensVw.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CDimView IMPLEMENT_DYNCREATE(CDimView, CView) BEGIN_MESSAGE_MAP(CDimView, CView) //{{AFX_MSG_MAP(CDimView) ON_WM_CREATE() ON_COMMAND(ID_ALL_ERRORS, OnAllErrors) ON_UPDATE_COMMAND_UI(ID_ALL_ERRORS, OnUpdateAllErrors) //}}AFX_MSG_MAP ON_MESSAGE(WM_HANDLEPALETTE,OnHandlePalette) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDimView construction/destruction CDimView::CDimView() { // TODO: add construction code here } CDimView::~CDimView() { } BOOL CDimView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CDimView drawing void CDimView::OnDraw(CDC* pDC) { CDim1Doc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } ///////////////////////////////////////////////////////////////////////////// // CDimView diagnostics #ifdef _DEBUG void CDimView::AssertValid() const { CView::AssertValid(); } void CDimView::Dump(CDumpContext& dc) const { CView::Dump(dc); } CDim1Doc* CDimView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDim1Doc))); return (CDim1Doc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CDimView message handlers int CDimView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here m_LBitmapWnd.SetWndHandle(GetSafeHwnd()); return 0; } void CDimView::OnAllErrors() { // TODO: Add your command handler code here LBase::DisplayErrorList(m_hWnd); } void CDimView::OnUpdateAllErrors(CCmdUI* pCmdUI) { // TODO: Add your command update UI handler code here pCmdUI->Enable(LBase::GetErrorsNumber()); } LRESULT CDimView::OnHandlePalette(WPARAM wParam,LPARAM lParam) { if(lParam==TRUE) { m_LBitmapWnd.HandlePalette(WM_PALETTECHANGED,wParam,0); m_LBitmapWnd.Repaint(); } else { if(m_LBitmapWnd.HandlePalette(WM_QUERYNEWPALETTE,0,0)==FALSE) m_LBitmapWnd.Repaint(); } return TRUE; } void CDimView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView) { if(bActivate==TRUE&&pActivateView==this) { m_LBitmapWnd.HandlePalette(WM_QUERYNEWPALETTE,0,0); ::SetFocus(m_LBitmapWnd.GetBitmapWnd()); } }