我想写一个画曲线图的类。
1.能画出xy轴坐标。
2.鼠标放在曲线上能显示出xy轴的数据。这个类我想从CWin类继承下来,可是不知道怎么写,恳请各位大侠给我提示,分不够再加。
1.这个类怎么实现自绘功能,比如我在外部设定xy轴的最大最小值,怎么把xy轴坐标画出来。
2.怎么响应鼠标移动这个消息,比如我鼠标在曲线图上移动的时候,鼠标显示一个浮动窗口,显示xy轴数据。
1.能画出xy轴坐标。
2.鼠标放在曲线上能显示出xy轴的数据。这个类我想从CWin类继承下来,可是不知道怎么写,恳请各位大侠给我提示,分不够再加。
1.这个类怎么实现自绘功能,比如我在外部设定xy轴的最大最小值,怎么把xy轴坐标画出来。
2.怎么响应鼠标移动这个消息,比如我鼠标在曲线图上移动的时候,鼠标显示一个浮动窗口,显示xy轴数据。
解决方案 »
- 请教打印机串口编程仿真模式的问题
- 陆老师DirectShow实务 叠加文字
- 怎样在View被关闭时保存一些信息?
- 我在diaog上有个iocn的图标 我想用鼠标点它 能拿起来移动到diaog其他地方 用什么函数?
- 怎么让VC开发环境中的提示窗口重现,百分相赠。
- 有关串行化的问题?
- 如何制作能显示提示用户操作的消息以及操作结果的窗口?
- win32 console application中使用了directshow
- 在VC程序中开一个新窗体,隶属于主程序,但要求属于非模式窗体!
- How to implementDIALOG in DLL?
- 【公告】南京程序员协会正式成立! 赶快申请加入会员!
- Sql server 2000数据库的数字型字段为何不能向ACCESS一样 “自动编号”??
画出xy坐标,可以响应WM_PAINT的消息,使用DC来画
鼠标移动,可以在WM_MOUSEMOVE消息中得到相关数据,而显示浮动窗口,则可以用tooltip来实现
能不能给我一个简单的从CWnd类继承的例子。
比如就在窗口上画个圆圈。
{
// Construction
public:
CTestWnd();// Attributes
public:// Operations
public:// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestWnd)
//}}AFX_VIRTUAL// Implementation
public:
virtual ~CTestWnd(); // Generated message map functions
protected:
//{{AFX_MSG(CTestWnd)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};TestWnd.cpp:// TestWnd.cpp : implementation file
//#include "stdafx.h"
#include "test.h"
#include "TestWnd.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CTestWndCTestWnd::CTestWnd()
{
}CTestWnd::~CTestWnd()
{
}
BEGIN_MESSAGE_MAP(CTestWnd, CWnd)
//{{AFX_MSG_MAP(CTestWnd)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestWnd message handlersvoid CTestWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CRect rcClient;
GetClientRect(rcClient); dc.Ellipse(rcClient);
// Do not call CWnd::OnPaint() for painting messages
}
http://www.fixdown.com/article/article/1070.htm