Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[5641a0]: ImageView.h Maximize Restore History

Download this file

ImageView.h    151 lines (137 with data), 4.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#if !defined(AFX_IMAGEVIEW_H__5E92EE7C_8629_40B0_AA23_1FA9751BF88A__INCLUDED_)
#define AFX_IMAGEVIEW_H__5E92EE7C_8629_40B0_AA23_1FA9751BF88A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ImageView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CImageView dialog
#define GREY RGB(190,190,190)
//// imageview mode flags
#define IW_ENABLEBUTTON 1 //enables the 'back' button
#define IW_SETVERTEX 2 //doesn't remove the window when clicked on it
#define IW_SHOWGRID 4
#define IW_PLACEIMAGE 8
#define IW_MATCH 16 //match the image
#define IW_NOREDRAW 32
#define IW_EDITMAP 64 //edit a map (light/search/height)
#define IW_OVERLAY 128 //edit overlay
#define IW_MARKTILE 256
#define IW_ENABLEFILL 512
#define IW_GETPOLYGON 1024 //draws all polygons, you are allowed to select one
#define IW_SHOWALL 2048 //show all button
#define IW_AUTOSET 4096 //when clicked on bitmap, call IDOK
typedef CList<CPoint, CPoint &> CPointList;
class CImageView : public CDialog
{
// Construction
public:
CImageView(CWnd* pParent = NULL); // standard constructor
void InitView(int flags, Cmos *my_mos=NULL); //sets the viewer to the current mos dimensions
void SetMapType(int maptype, LPVOID map);
void SetOverlay(bool type);
void RedrawContent();
void RefreshDialog();
void SetupAnimationPlacement(Cbam *bam, int orgx, int orgy, int frame);
void DrawGrid();
CPoint GetPoint(int frame);
void SetPoint(CPoint &point, int frame);
// Dialog Data
//{{AFX_DATA(CImageView)
enum { IDD = IDD_IMAGEVIEW };
CButton m_fill_control;
CButton m_overlay_control;
CButton m_showgrid_control;
CComboBox m_value_control;
CButton m_showall_control;
CSpinButtonCtrl m_spiny;
CSpinButtonCtrl m_spinx;
CButton m_setbutton;
CScrollBar m_vertical;
CScrollBar m_horizontal;
CButton m_button;
CStatic m_bitmap;
int m_value;
BOOL m_showall;
BOOL m_showgrid;
BOOL m_fill;
BOOL m_text;
//}}AFX_DATA
int m_actvertex, m_vertexcount;
int m_max;
int m_maptype;
CPoint m_oladjust;
CPoint m_mousepoint;
CPoint m_sourcepoint;
CPoint m_confirmed;
int m_maxclipx, m_maxclipy;
int m_minclipx, m_minclipy;
int m_clipx, m_clipy;
int m_enablebutton;
int m_maxextentx, m_maxextenty;
Cbam *m_animbam;
int m_frame;
LPVOID m_map;
area_vertex *m_polygon;
COLORREF *m_palette;
HBITMAP m_bm; //accessed from chui editor
Cmos *m_mos;
COLORREF m_gridcolor1;
COLORREF m_gridcolor2;
COLORREF m_gridcolor3;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CImageView)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
CBitmap m_lines;
void PutPixel(CPoint point, unsigned char color);
int GetPixel(CPoint point);
void FloodFill(CPoint point, unsigned char color);
void DrawLine(CPoint source, CPoint destination, unsigned char color);
void DrawActors();
void DrawAnims();
void DrawMapText();
void DrawIcons();
void DrawAmbients();
void DrawPolyPolygon(CPtrList *polygons);
void CenterPolygon(CPtrList *polygons, int idx);
POSITION GetPolygonAt(CPtrList *polygons, int idx);
int GetCountPolygon();
CString GetPolygonText(int idx);
short *GetPolygonBox(int idx);
int GetPolygonSize(int idx);
inline int IsPointInPolygon(void *wedvertex, int idx, CPoint point);
int FindPolygon(CPtrList *polygons, CPoint point);
int FindAmbient(area_ambient *ambients, CPoint point);
void DrawCircle(int x, int y, int radius, int colorindex);
void DrawLines(POINTS *polygon, unsigned int count, CString title, int fill, int actv);
void DrawMap(); //light, height, search maps
// Generated message map functions
//{{AFX_MSG(CImageView)
virtual BOOL OnInitDialog();
afx_msg void OnBitmap();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnDeltaposSpinx(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSpiny(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKillfocusValue();
afx_msg void OnShowall();
afx_msg void OnSelchangeValue();
afx_msg void OnShowgrid();
afx_msg void OnFill();
afx_msg void OnOverlay();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_IMAGEVIEW_H__5E92EE7C_8629_40B0_AA23_1FA9751BF88A__INCLUDED_)