关键词不能为空

当前您在: 主页 > 英语 >

NTGraph

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-28 08:31
tags:

-

2021年2月28日发(作者:点名册)


?



?



?



Download source files - 381 Kb




Download demo projects - 200 Kb




Download control binaries - 72 Kb





Introduction


This is a simple OCX control, which allows you to plot two-dimensional data. Despite


the large set of controls that comes with VC++, there is no out-of-the-box control


that provides a simple and straightforward 2D data visualization. The


ActiveX


control tutorial


by Kapil Chaturvedi inspired me to write my own control, mostly


because I wanted to customize the source code when needed. Over time, the


functionality of the ActiveX control became more elaborate, and finally I made


decision to publish what I have in hand.


What Can It Do?


The control is able to plot a large number of points and updating one or more plots


on the graph with new data, replacing the old plot with the new plot. Multiple plots


with individual properties such as name, line and point style, width, could be


customized at runtime. At runtime, the control is capable of displaying its own


property pages (double click on the control area or by invoking the ShowProperties


method) and showing short help as a result of the user pressing


F1


while the control


has the focus. By setting the TrackMode property you should be able to switch


between a different modes such as tracking cursor coordinates while moving (left


mouse button pressed), zooming, XY-, X-, and Y-panning. Finally the control


snapshot could be copied to the clipboard, printed, or saved as a bitmap file.



What doesn't it do?


You cannot plot 3D data, but you can use the


NTGraph3D ATL/STL/OpenGL


activeX control


to do that :-)!



What's New?


?



?



?



?



?



The Log Axes Mode works now, showing the log10 grid, and appropriated


labels, it also converts the graph element's data



The control's snapshot could be now saved as a bitmap file, many thanks to


Robert Harber


for providing the code!



Added abilities to dynamically creating annotation labels, that can be on


different colors, orientations, and also could be hidden or visible.



Added


annotation list in the real/design mode.



Added abilities to dynamically drawing of multiply cursors, with a different


colors, crosshair styles, floating/fixed, or snapped to the currently selected


element!



?



?



?



Added


the real/design mode.



Added axis formatting, that allows a customization of the bottom and left


axis labels.



Added


properties, and a templates for of commonly used data formats such a:


Numbers, Exponential, Symbolic, Date, and Time!



?



Added Time format for the graph axes. To use it, you should set the


XTime/YTime


property to


True


.



You also have to convert the date/time data to


double


format. The


Date/Time format is implemented as a as a floating-point value, measuring


days from midnight, 30 December 1899. So, midnight, 31 December 1899 is


represented by 1.0. Similarly, 6 AM, 1 January 1900 is represented by 2.25,


and midnight, 29 December 1899 is 1.0. However, 6 AM, 29 December 1899


is 1.25.


For more info refer to MSDN for the class:


COleDateTime


!



How to test the control


You can use the ActiveX Control Test Container, and load the macro from


the menu ToolsMacros... You can write your own routines to test the control


behavior (look at macro)



How to use the control


To use this OCX control, embed it in an application that supports the use of OCX


controls. Microsoft Visual Basic applications, Office applications and applications


created with the Micro


soft Developer Studio’s AppWizard can support the use of


OCX controls. There are two files required to use this control. They are:



?



?



-The help file for this control.



-The NTGraph controls code and data.



Before the ActiveX control can be used in your application, it must be registered as


a COM Component in the system registry. This is a self registering control. This


means that to register the control in the system registry you only need to have an


application load the control and ca


ll the control’s exported function


DllRegisterServer. You can use the REGSVR32 utility or have your setup program do


this.



How to use the REGSVR32 utility?


Copy



to your directory and type:



regsvr32




regsvr32 /u


(Unregister server)



Customizing The Control


You can change the properties of this control during design time, or in run time to


affect how the control will plot the data.


Use the new control property pages:



Graph Property Page



Elements Property Page



Annotations Property Page



Cursors Property Page



Format Property Page



You can include the control in your project by following the standard steps for


ActiveX controls:


1.



Create MFC Dialog project or MDI/SDI project with View class derived from


CFormView




2.



Choose menu Project|Add To Project|Components and Controls...



3.



Open the Registered ActiveX Control gallery



4.



Choose the


NTGraph


Control and click Insert



5.



Visual C++ will generate the class


CNTGraph




6.



Then you can define variable of the type as


CNTGraph.




The control's customization options are straightforward:


// Customize Graph Properties



m_kColor (RGB(< /p>


0


,


0


,


0


));


m_sColor (RGB(< /p>


0


,


255


,< /p>


0


));


m_elColor (RG B(


128


,


255

< br>,


255


));



// Control's Frame and Plot area options


m_meColor((RGB(


0


,


0


,


0


));


m_tAreaColor(RGB(


21 2


,


222


,


200


));



m_meStyle(


2


)


// (1) - Flat



//


(2) -


Scope


(raised


frame


and


sunken


plot


area


borders)



// (3) - 3DFrame (a bitmap frame picture)



m_dColor(RGB(< /p>


192


,


192


,


192


));


m_wGrid (TRUE);



m_sorColor (RGB(


255


,


0


,


0


));


m_ckMode (


1


);



m_phTitle(



);


m_bel (



);


m_bel(



);

< br>m_ge(


0


.,


10


,-


1


,


1

< p>
.);


You don't need to call the control


Invalidate()


function every time you change a


Graph property. The changes are automatically reflected on the control appearance.


To load the data into the control...


Collapse


//


//


// Customize Graph Elements


//


//



// The Graph elements are dynamically allocated!




// Element 0 is allocated by default



// Even after a call to the ClearGraph method,



// the Element-0 is automaticaly allocated.



m_mentLineColor(RGB(


255


,


0


,


0


));


m_mentLinetype(


0


);


m_mentWidth(


1


);



m_mentPointColor(RGB(


0


,


0


,


255


);


m_mentPointSymbol(


3


);


m_mentSolidPoint(TRUE);





// Allocate a new element: Element-1


m_ment();




m_mentColor (RGB(


0


,

255


,


0


));


m_mentLinewidth(


1


);


m_mentLinetype(


2


);




// Allocate a new element: Element-2


m_ment();


-


-


-


-


-


-


-


-



本文更新与2021-02-28 08:31,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/679899.html

NTGraph的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文