www.pudn.com > RSImageManger.rar > ImageMangerView.h
// ImageMangerView.h : interface of the CImageMangerView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_IMGMANGERVIEW_H__CAA1A971_79FA_11D5_AA4E_0050BAB0CAD3__INCLUDED_)
#define AFX_IMGMANGERVIEW_H__CAA1A971_79FA_11D5_AA4E_0050BAB0CAD3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// 屏幕宽度
//#define SCREENW 640 //1024 //640 注意与Image.h中的定义保持一致
// 屏幕高度
//#define SCREENH 480 //768 //480
#include "Image.h"
class CImageMangerView : public CScrollView
{
protected: // create from serialization only
CImageMangerView();
DECLARE_DYNCREATE(CImageMangerView)
// Attributes
public:
CImageMangerDoc* GetDocument();
// Operations
public:
int ImgBatFlag;//用来执行批处理的标志
CString m_FileName;
int SlicerNum;
public: //转换
BOOL CBmptojpg();
BOOL CBmptoimg();
BOOL CJpgtobmp();
BOOL CBmp8to24();
BOOL CBmp24to256();
BOOL BmpToTiff() ;
BOOL TiffToBmp();
public:
BYTE *m_buf;
BYTE *m_ntmp;
UINT m_width; //原始图象的宽度
UINT m_height;
UINT m_widthDW;
int m_color;//1---RGB ,0--Grayscale,-1--初始值
// draw what we've loaded
void DrawBMP(CDC* pDC);
// jpg load save
void LoadJPG(CString fileName);
void SaveJPG(CString filename, BOOL color);
// gif load save
void LoadGIF(CString fileName);
void SaveGIF(CString filename);
void LoadBMP(CString fileName);
void SaveBMP24(CString fileName);
// turn 24-bit to 256-color gray scale
BYTE * MakeColormappedGrayscale(BYTE *inBuf,
UINT inWidth,
UINT inHeight,
UINT inWidthBytes,
UINT colors,
RGBQUAD* colormap);
// Operations
protected:
HCURSOR m_HCross,m_HCur1;//手形,用于漫游;
int m_Dragging;
public:
//选择菜单m_SelectMenu 赋值 0---缺省,1--拉框显示,2--打开img文件,3--显示全图,
//4--显示全局影象(去掉),5--打开BMP|JPEG等 8-- 9--生成地名文件 10--查询地名
int m_SelectMenu;
int PushNumb;//表示按下鼠标左键的字数
CPoint mPointOrign;//记录鼠标第一次按下的值,鼠标移动时
int m_lastwide,m_lastheight;//用来保存上一幅图象的宽、高
int m_StratPointX,m_StratPointY;//用来记录上一幅子图象(即拉框图象)在整幅图象中的坐标
int m_ZoomScale;//初始化为0
int m_GetFlag;//判断是否已经选择了拉框显示
BOOL m_bImageReady;//已读入图象的标志
BOOL ViewFlag;//0为可视处理,1为非可视化处理
public:
int screenX0,screenY0;//0,0像素显示的左上角坐标,这里设为10
int screenX1,screenY1,m_ZoomX,m_ZoomY;
public:
int nPalate;
HPALETTE hpal;
HBITMAP bhm_ddb;
public:
CImageDe* m_pImage;
public:
void Paint(CDC* pDC);
void drawAllMap(CDC *pDC);
void DrawBmp(CDC* pDC,int x,int y,int wide,int high,int DrawMode);
void DrawAllView(CDC* pDC);
void DrawBmp3(CDC* pDC,int x,int y,int wide,int high,int DrawMode);
void DrawBmp4(CDC* pDC,int x,int y,int wide,int high,char *fName,int DrawMode);
void make_palette() ;
void DIBtoDDB(HDC hdc) ;
protected:
CRect m_Rect; //规定所显示图象区域的范围
public:
CArray<MetaData_Name,MetaData_Name> RegionNameArray;
public://8-26系统参数
BOOL m_checkstatus;
int m_Dlgdm;
int m_jpegratio;
int m_ColorFlag;//0,灰度图象或8bit位图 1,RGB图象或24位位图 初始值为-1
public:
void CRectWorkingArea(CRect rect);
BOOL ShowStatusBar(CPoint showpoint);//状态条上显示坐标值
BOOL ShowName(CPoint point,CString &amt;RegionName);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CImageMangerView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT&amt; cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CImageMangerView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext&amt; dc) const;
#endif
public:
//virtual void OnFileOpen();
protected:
//{{AFX_MSG(CImageMangerView)
afx_msg void OnDecomeinfour();
afx_msg void OnFileGetdimensionsjpg();
afx_msg void OnFileSaveAs();
afx_msg void OnFileSavecolormappedbmp(CString fileName);
afx_msg void OnFileSavegrayas();
afx_msg void OnImageBatcompress();
afx_msg void OnImageNoview();
afx_msg void OnMosaicLocate();
afx_msg void OnOpenindex();
afx_msg void OnOutputbmp();
afx_msg void OnViewinbox();
afx_msg void OnViewingrid();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnFileOpen();
afx_msg void OnOpenbigbmp();
afx_msg void OnImageResample();
afx_msg void OnWalkview();
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnPutdmfile();
afx_msg void OnConfig();
afx_msg void OnImageTiff();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in ImageMangerView.cpp
inline CImageMangerDoc* CImageMangerView::GetDocument()
{ return (CImageMangerDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IMGMANGERVIEW_H__CAA1A971_79FA_11D5_AA4E_0050BAB0CAD3__INCLUDED_)