14.1. Using GDI in the Managed Environment

One important feature of the .NET runtime is COM and Win32 interoperability. With runtime interoperability services, developers can use both COM and Win32 libraries in managed applications. The classes related to these services are defined in the System.Runtime.InteropServices namespace.

We can use COM libraries in managed applications by simply adding a reference to the COM library using the Add Reference option of VS.NET or the Type Library Importer (Tlbimp.exe) .NET tool. Both of these options allow developers to convert a COM library to a .NET assembly, which can then be treated as other .NET assemblies. The graphical user interface (GUI) functionality of Windows is defined in a Win32 library called ...

Get Graphics Programming with GDI+ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.