-
大小: 89.32MB文件类型: .zip金币: 2下载: 1 次发布日期: 2023-05-15
- 语言: C/C++
- 标签: high-speed c
资源简介
High-speed Charting Control Demo,用于MFC画图(包含鼠标响应),具体实现参考作者博客
代码片段和文件信息
/*
*
* ChartAxis.cpp
*
* Written by C閐ric Moonen (cedric_moonen@hotmail.com)
*
*
*
* This code may be used for any non-commercial and commercial purposes in a compiled form.
* The code may be redistributed as long as it remains unmodified and providing that the
* author name and this disclaimer remain intact. The sources can be modified WITH the author
* consent only.
*
* This code is provided without any garanties. I cannot be held responsible for the damage or
* the loss of time it causes. Use it at your own risks
*
* An e-mail to notify me that you are using this code is appreciated also.
*
*/
#include “stdafx.h“
#include “ChartAxis.h“
#include “ChartAxisLabel.h“
#include “ChartGrid.h“
#include “ChartCtrl.h“
#include “Math.h“
#include
using namespace std;
CChartAxis::CChartAxis()
: m_pParentCtrl(NULL) m_bIsHorizontal(true) m_bIsInverted(false)
m_AutoMode(NotAutomatic) m_bIsVisible(true) m_bIsSecondary(false)
m_MaxValue(0) m_MinValue(0) m_UnzoomMax(0) m_UnzoomMin(0)
m_bAutoTicks(true) m_bDiscrete(false)m_StartPos(0) m_EndPos(0)
m_nFontSize(80) m_strFontName(_T(“Microsoft Sans Serif“)) m_TextColor(0)
m_bAutoMargin(true) m_iMarginSize(0) m_bZoomEnabled(true)
m_dZoomLimit(0.001) m_pScrollBar(NULL) m_AxisColor(RGB(000))
{
m_pAxisGrid = new CChartGrid();
m_pAxisLabel = new CChartAxisLabel();
}
CChartAxis::~CChartAxis()
{
if (m_pAxisGrid)
{
delete m_pAxisGrid;
m_pAxisGrid = NULL;
}
if (m_pAxisLabel)
{
delete m_pAxisLabel;
m_pAxisLabel = NULL;
}
if (m_pScrollBar)
{
delete m_pScrollBar;
m_pScrollBar = NULL;
}
}
int CChartAxis::GetPosition()
{
if (m_bIsHorizontal)
{
if (m_bIsSecondary)
return 0;
else
return 100;
}
else
{
if (m_bIsSecondary)
return 100;
else
return 0;
}
}
void CChartAxis::SetParent(CChartCtrl* pParent)
{
m_pParentCtrl = pParent;
m_pAxisGrid->m_pParentCtrl = pParent;
m_pAxisLabel->m_pParentCtrl = pParent;
}
void CChartAxis::SetHorizontal(bool bHorizontal)
{
m_bIsHorizontal = bHorizontal;
m_pAxisGrid->m_bIsHorizontal = bHorizontal;
m_pAxisLabel->SetHorizontal(bHorizontal);
}
void CChartAxis::Draw(CDC *pDC)
{
if (!m_bIsVisible)
return;
if (pDC->GetSafeHdc() == NULL)
return;
// Initialize the different GDI objects
CPen SolidPen(PS_SOLID0m_AxisColor);
CFont NewFont;
NewFont.CreatePointFont(m_nFontSizem_strFontName.c_str()pDC) ;
CPen* pOldPen = pDC->Selectobject(&SolidPen);
CFont* pOldFont = pDC->Selectobject(&NewFont);
COLORREF OldTextColor = pDC->SetTextColor(m_TextColor);
int iPrevMode = pDC->SetBkMode(TRANSPARENT);
// Draw the axis line
int Pos = 0;
if (m_bIsHorizontal)
{
if (!m_bIsSecondary)
Pos = m_AxisRect.top+1;
else
Pos = m_AxisRect.bottom-1;
pDC->MoveTo(m_StartPosPos);
pDC->LineTo(m_EndPosPos);
}
else
{
if (!m_bIsSec
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-02-14 19:25 High-speed Charting Control Demo\
目录 0 2019-02-14 18:37 High-speed Charting Control Demo\ChartCtrl\
目录 0 2019-02-14 18:37 High-speed Charting Control Demo\ChartCtrl\.svn\
文件 3966 2010-07-10 11:56 High-speed Charting Control Demo\ChartCtrl\.svn\all-wcprops
文件 7834 2010-07-10 11:56 High-speed Charting Control Demo\ChartCtrl\.svn\entries
文件 2 2009-03-07 12:19 High-speed Charting Control Demo\ChartCtrl\.svn\format
目录 0 2019-02-14 19:25 High-speed Charting Control Demo\ChartCtrl\.svn\prop-ba
目录 0 2019-02-14 19:25 High-speed Charting Control Demo\ChartCtrl\.svn\props\
目录 0 2019-02-14 18:37 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 19260 2009-12-23 12:05 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 17455 2009-12-23 12:05 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3742 2009-04-04 10:54 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3155 2009-12-21 11:39 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3142 2009-12-22 12:02 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3815 2010-01-17 14:13 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 9777 2010-01-03 12:00 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 6911 2009-10-25 17:22 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 7082 2009-12-28 11:28 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 4320 2009-12-20 12:44 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 1757 2009-02-08 12:48 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 1972 2009-03-08 18:14 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 31179 2009-12-28 11:32 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 21115 2009-12-28 11:32 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 1483 2009-02-17 20:35 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3819 2010-01-21 20:31 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 10516 2009-12-26 18:41 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 5216 2009-03-07 13:01 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 2438 2009-02-03 21:09 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 2189 2009-03-08 18:19 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 3375 2009-05-18 21:00 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
文件 2923 2009-03-07 20:43 High-speed Charting Control Demo\ChartCtrl\.svn\text-ba
............此处省略299个文件信息
相关资源
- 物联网GPS跟踪器demo程序
- 嵌入式c编程语言入门与深入.pdf58199
- C51单片机技术教程(304页)
- C语言模块化编程(我见过最好的)
- 基于esp32的摄像头采集图像代码
- C51单片机交通
- PCA9539驱动程序
- STM32连接EC20使用内置MQTT协议接入阿里
- TM4C123中文手册
- 单片机C语言实战开发108例
- stm32 AD7506
- stc-isp-15xx-v6.86G
- Linux那些事儿之我是USB core
- STC8G1K08A红外遥控点灯
- C语言的嵌入式汇编基本使用.docx(2页
- stm32f103c8t6开发板原理图+pcb
- Arduino 敲琴MIDI电子琴 程序报告.docx
- CAN实验
- LCD驱动芯片ST7701SI SPI接口底层驱动配
- 显示屏操作(stm32f103c8t6(SAN))
- USB CAN Tool 源代码(LabVIEW 2011环境)
- Proteus 8.6仿真STM32F103C6
- atmega128 串口通讯(RS485.c)
- C语言嵌入式Modbus协议栈,支持主站和
- stm32 +w5500 裸机 远程升级 自动dns pi
- 永磁同步电机的FOC控制算法
- arduino I2C设备扫描并串口返回地址(
- Proteus仿真:LCD液晶屏显示.rar
- STM32 PCB封装库 全系列 全网不好找
- 基于STM32F407的W5500 tcpserver(官网例程
评论
共有 条评论