📄 绘制饼状图3view.h
字号:
// 绘制饼状图3View.h : interface of the CMy3View class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_3VIEW_H__77B674E2_4A66_43FC_97F4_3858212E670C__INCLUDED_)
#define AFX_3VIEW_H__77B674E2_4A66_43FC_97F4_3858212E670C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//color definitions 24种颜色
#define RED RGB(255,0,0)
#define GREEN RGB(0,255,0)
#define BLUE RGB(0,0,255)
#define YELLOW RGB(255,255,0)
#define ORANGE RGB(255,153,51) //橙色
#define HOT_PINK RGB(255,51,153) //粉红色
#define PURPLE RGB(153,0,204)//紫色
#define CYAN RGB(0,255,255)//蓝绿色, 青色
#define LAVENDER RGB(199,177,255)//淡紫色的
#define PEACH RGB(255,226,177)//桃色
#define SKY_BLUE RGB(142,255,255)//天蓝色
#define FOREST_GREEN RGB(0,192,0)//丛林绿色
#define BROWN RGB(80,50,0)//褐色的, 棕色的
#define TURQUOISE RGB(0,192,192)//青绿色
#define ROYAL_BLUE RGB(0,0,192)//宝蓝色
#define GREY RGB(192,192,192)//灰色
#define DARK_GREY RGB(128,128,128)// 暗灰色
#define TAN RGB(255,198,107)//棕褐色的, 茶色
#define DARK_BLUE RGB(0,0,128)//暗蓝色
#define MAROON RGB(128,0,0)//栗色
#define DUSK RGB(255,143,107)//薄暮, 黄昏色
#define LIGHT_GREY RGB(225,225,225) //亮灰色//only for 3D graph lines
class CMy3View : public CView
{
protected: // create from serialization only
CMy3View();
DECLARE_DYNCREATE(CMy3View)
// Attributes
public:
CMy3Doc* GetDocument();
CUIntArray m_piearray; //每个扇形的分割百分比,总和为100
CStringArray m_item; //每一项的名字,和m_piearray对齐
int m_w; //椭圆的宽
int m_h; //椭圆的高
int m_B; //饼图的厚度
int m_x;//椭圆的左上角位置x,y
int m_y;
COLORREF dwoncolor[21];
COLORREF upcolor[21];
CDC* pMemDC; //定义内存DC指针
CBitmap* pBitmap; //定义内存位图指针
//将在视的构造函数中构造他们的对象
int m_nMaxX; //屏幕大小X、Y值
int m_nMaxY;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMy3View)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMy3View();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
void Serialize_piearray();
int ReformatPieary();
//{{AFX_MSG(CMy3View)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in 绘制饼状图3View.cpp
inline CMy3Doc* CMy3View::GetDocument()
{ return (CMy3Doc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_3VIEW_H__77B674E2_4A66_43FC_97F4_3858212E670C__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -