📄 coordinate.h
字号:
// Coordinate.h: interface for the CCoordinate class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_COORDINATE_H__4DF47056_B167_11D4_BC0C_00D059085249__INCLUDED_)
#define AFX_COORDINATE_H__4DF47056_B167_11D4_BC0C_00D059085249__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "PrintCoordinate.h"
#include "TrackLookButton.h"//为了显示彩色按钮
//坐标图显示
class CCoordinate
{
public:
CDC memDC;
CRect m_rectDraw;
int SetBkMode(int nBkMode);
void LineTo(CPoint pt,COLORREF color);
void LineTo(int x,int y,COLORREF color);
void SetXRange(int nXmin,int nXmax); //设置X方向范围
void SetYRange(int nYmin,int nYmax); //设置Y方向范围
void DrawXRefBottom(float fmin,float fmax,int ndiv=1); //显示X方向底部的坐标
void DrawYRefLeft(float fmin,float fmax,int ndiv=1); //显示Y方向左边的坐标
void DrawXRefTop(float fmin,float fmax,int ndiv=1); //显示X方向上部的坐标
void DrawYRefRight(float fmin,float fmax,int ndiv=1); //显示Y方向右边的坐标
void DrawPoly(unsigned char *data,int len,COLORREF color,int offset=0,int pos=0); //显示曲线
void DrawPoly(unsigned short *data,int len,COLORREF color,int offset=0,int pos=0); //显示曲线
void DrawBack(COLORREF color); //画背景
//以字符串中间为基准在X方向的底部显示
void TextOutXCenterBottom(int x,int y,CString str,COLORREF textColor);
//以字符串中间为基准在Y方向的左边显示
void TextOutYCenterLeft(int x,int y,CString str,COLORREF textColor);
//以字符串中间为基准在X方向的上部显示
void TextOutXCenterTop(int x,int y,CString str,COLORREF textColor);
//以字符串中间为基准在Y方向的右边显示
void TextOutYCenterRight(int x,int y,CString str,COLORREF textColor);
//以字符串中间为基准在X方向显示
void TextOutXCenter(int x,int y,CString str,COLORREF textColor);
//以字符串中间为基准在Y方向显示
void TextOutYCenter(int x,int y,CString str,COLORREF textColor);
void DrawYGrid(COLORREF color,int n=1); //画X和Y方向的网格
void DrawXGrid(COLORREF color,int n=1);
void DrawYAxis(COLORREF color);
void TextOut(int x,int y,CString str);
void LineTo(CPoint pt);
void MoveTo(CPoint pt);
void Point_Conv(CPoint *point); //在用户坐标系和屏幕之间转换
void DrawXAxis(COLORREF color);
void SetXYRange(int xmin,int xmax,int ymin,int ymax); //设置XY方向的范围
int BitBlt(CDC *pDC,LPRECT lpRect); //显示图形结果
void Release();
void InitRect(LPRECT lpRect);
CCoordinate();
virtual ~CCoordinate();
int m_nXmin;
void SetPixel(int x, int y, COLORREF cr);
void SetPixel(CPoint pt, COLORREF cr);
BOOL Pie(CPoint ptStart, COLORREF cr, int offsetx = 1, int offsety = 1);
BOOL Pie(int x, int y, COLORREF cr, int offsetx = 1, int offsety = 1);
BOOL Pie(LPCRECT lpRect, POINT ptStart, POINT ptEnd, COLORREF cr);
BOOL Pie(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, COLORREF cr);
protected:
CBitmap bmpMap;
int m_nYmax; //两个方向的范围
int m_nYmin;
int m_nXmax;
private:
BOOL IsPrinting;
COLORREF m_colorBack;
COLORREF m_colorGrid;
CPoint PointConv(CPoint point);
CPoint m_pointOrigin;
//CRect m_rectDraw;
};
#endif // !defined(AFX_COORDINATE_H__4DF47056_B167_11D4_BC0C_00D059085249__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -