The ability to visualize problems and data can be of great use when trying to understand difficult concepts and, hence, can be of great use to scientists. Perhaps the most obvious application of visualization in science is in the study of molecules, particularly biological molecules. However, a great many other problems can also be elucidated through the use of visualization, particularly real-time and interactive graphics which can go well beyond the capabilities of the previous generation of static, made-for-print graphics.

This chapter introduces two tools that are essential for the development of sophisticated graphical applications on the Windows platform:

  • Windows Forms for writing graphical user interfaces (GUIs).

  • Managed DirectX for generating high-performance, real-time and interactive graphics.

These tools are then used to develop a library that allows easy-to-use graphical applications to be spawned seamlessly from the F# interactive mode, and an example stand-alone graphical application for visualizing scientific data.

Several of the complete example programs presented in chapter 12 use the scene graph library developed in this chapter.


A great deal is expected of modern computer programs. They should provide a graphical user interface that presents the necessary information to the user in a clear and comprehensible way.

Fortunately, Windows Forms provides an easy way to create graphical user interfaces. Using Visual Studio, GUIs can be ...

Get F# for Scientists now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.