Поделиться через


Ink.Save - метод (PersistenceFormat)

Обновлен: Ноябрь 2007

Converts the Ink object to the specified format, saves it by using the DefaultCompressionMode and returns the binary data in a Byte array.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Function Save ( _
    p As PersistenceFormat _
) As Byte()
'Применение
Dim instance As Ink
Dim p As PersistenceFormat
Dim returnValue As Byte()

returnValue = instance.Save(p)
public byte[] Save(
    PersistenceFormat p
)
public:
array<unsigned char>^ Save(
    PersistenceFormat p
)
public byte[] Save(
    PersistenceFormat p
)
public function Save(
    p : PersistenceFormat
) : byte[]

Параметры

Возвращаемое значение

Тип: array<System.Byte[]
The Byte array that contains the persisted ink.

Заметки

Attempting to save an empty Ink object in Gif format generates an error.

ms569619.alert_note(ru-ru,VS.90).gifПримечание.

When calling the Save method with the p parameter set to Base64InkSerializedFormat, the return value is a null-terminated byte array. To write the saved ink to an XML file, first remove the last byte from the array before converting the array to an 8-bit Unicode Transformation Format (UTF-8)-encoded string.

Примеры

In this example, the Ink object of an InkOverlay object is saved to a file in Gif format.

Try
    ' FILE_NAME is a class level const
    Using FS As FileStream = New FileStream(FILE_NAME, FileMode.Create)
        Dim isf As Byte() = mInkOverlay.Ink.Save(PersistenceFormat.Gif)
        FS.Write(isf, 0, isf.Length)
    End Using

Catch
    ' handle or rethrow
End Try
try
{
    // FILE_NAME is a class level const
    using (FileStream FS = new FileStream(FILE_NAME, FileMode.Create))
    {
        byte[] isf = mInkOverlay.Ink.Save(PersistenceFormat.Gif);
        FS.Write(isf, 0, isf.Length);
    }
}
catch
{
    // handle or rethrow
}

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Ink Класс

Ink - члены

Save - перегрузка

Microsoft.Ink - пространство имен

Ink.Load

PersistenceFormat

CompressionMode