Share via


Surface.ReleaseGraphics() Method (Microsoft.DirectX.Direct3D)

Releases the device context obtained by calling Surface.GetGraphics.

Definition

Visual Basic Public Sub ReleaseGraphics()
C# public void ReleaseGraphics();
C++ public:
void ReleaseGraphics();
JScript public function ReleaseGraphics();

Remarks

A device context is a Microsoft Windows resource and must be released after use so the operating system can return it to the pool of available resources.

This method releases only the device context returned by Surface.GetGraphics, otherwise the method fails.

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

See Also