// Create a new matrix object using (Matrix myMatrix = new Matrix()) { // Do something with the matrix object myMatrix.Rotate(45); // Call Dispose to free up resources myMatrix.Dispose(); }In this example, we create a new matrix object, use it to perform a rotation, and then call the Dispose method to release any resources that were allocated by the object. The System.Drawing.Drawing2D namespace is part of the .NET Framework's System.Drawing package.