日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

十步会用IOCOMP–iplotx控件

發(fā)布時(shí)間:2024/3/13 编程问答 67 豆豆
生活随笔 收集整理的這篇文章主要介紹了 十步会用IOCOMP–iplotx控件 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

十步會(huì)用IOCOMP–iplotx控件

1、 新建項(xiàng)目-MFC-基于對(duì)話框
2、 插入ActiveX控件-選擇iPlotX Control
3、右擊該控件,添加變量,輸入變量名
4、類向?qū)?(Dlg結(jié)尾那個(gè)類)添加函數(shù)-IplotxInit(用于該控件基本參數(shù)設(shè)置)
5、在Dlg.cpp中開頭處添加以下代碼:

#import "iPlotLibrary.tlb" named_guids #include "atlbase.h" using namespace iPlotLibrary; CComPtr<iPlotLibrary::IiPlotX> PlotComponent;

6、在函數(shù)IplotxInit()中添加以下代碼:

CWnd* pPlotWnd = GetDlgItem(IDC_IPLOTX1);IUnknown* m_iUnknown;//Get iDispatch Inteface to Plot Componentm_iUnknown = pPlotWnd->GetControlUnknown();m_iUnknown->QueryInterface(__uuidof(iPlotLibrary::IiPlotX), (LPVOID*)&PlotComponent);//Setup ChannelsPlotComponent->RemoveAllChannels();PlotComponent->AddChannel();PlotComponent->AddChannel();PlotComponent->AddChannel();PlotComponent->AddChannel();PlotComponent->AddChannel();PlotComponent->AddChannel();PlotComponent->XAxis[0]->Span = 5;PlotComponent->Labels[0]->Caption = "曲線圖";PlotComponent->GetChannel(0)->TitleText = "曲線1";PlotComponent->GetChannel(1)->TitleText = "曲線2";PlotComponent->GetChannel(2)->TitleText = "曲線3";PlotComponent->GetChannel(3)->TitleText = "曲線4";PlotComponent->GetChannel(4)->TitleText = "曲線5";PlotComponent->GetChannel(5)->TitleText = "曲線6";

7、類向?qū)?添加消息處理函數(shù)OnTimer();
8、在OnInitDialog()函數(shù)return TRUE前添加以下代碼:

IplotxInit();SetTimer(1, 10, NULL);

9、在函數(shù)OnTimer();中添加以下函數(shù):

static float i = 10;PlotComponent->GetChannel(0)->AddYElapsedSeconds(40*sin(0.01*i));//AddYNow((int)i);PlotComponent->GetChannel(1)->AddYElapsedSeconds(40 * cos(0.01*i));//AddYNow((int)i);PlotComponent->GetChannel(2)->AddYElapsedSeconds(40 * sin(0.01*i + 1));//AddYNow((int)i);PlotComponent->GetChannel(3)->AddYElapsedSeconds(40 * cos(0.01*i + 1));//AddYNow((int)i);PlotComponent->GetChannel(4)->AddYElapsedSeconds(40 * sin(0.01*i + 2));PlotComponent->GetChannel(5)->AddYElapsedSeconds(40 * cos(0.01*i + 2));i++;i++;i++;

10、按F5鍵。
效果圖:

源碼下載:http://download.csdn.net/detail/cracent/9794944

總結(jié)

以上是生活随笔為你收集整理的十步会用IOCOMP–iplotx控件的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。