protected void WriteCursorToFile( Cursor cursor, string fileName )
{
TypeConverter converter = TypeDescriptor.GetConverter( typeof( Cursor ) );
byte[] blob = converter.ConvertTo( cursor, typeof( byte[] ) ) as byte[];
if ( blob == null )
{
MessageBox.Show( "Unable to convert Cursor to byte[]" );
return;
}
FileStream fileStream = new FileStream( fileName, FileMode.Create );
fileStream.Write( blob, 0, blob.Length );
fileStream.Flush();
fileStream.Close();
}
Contributed from George Shepherd's Windows Forms FAQ