Microsoft DirectX 9.0 SDK Update (October 2004)

SurfaceLoader.SaveToStream Method

Language:

Note: This documentation is preliminary and is subject to change.

Saves a surface to a stream.

Definition

Visual Basic .NET Public Shared Function SaveToStream( _
    ByVal destFormat As ImageFileFormat, _
    ByVal srcSurface As Surface, _
    ByRef sourcePalette As PaletteEntry _
) As GraphicsStream
C# public static GraphicsStream SaveToStream(
    ImageFileFormat destFormat,
    Surface srcSurface,
    out PaletteEntry sourcePalette
);
Managed C++ public: static GraphicsStream* SaveToStream(
    ImageFileFormat destFormat,
    Surface *srcSurface,
    PaletteEntry *sourcePalette
);
JScript .NET public static function SaveToStream(
    destFormat : ImageFileFormat,
    srcSurface : Surface,
    sourcePalette : PaletteEntry
) : GraphicsStream;

Parameters

destFormat Microsoft.DirectX.Direct3D.ImageFileFormat. An ImageFileFormat object that specifies the file format to use when saving the surface to a stream. This method supports saving to all ImageFileFormat types except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).
srcSurface Microsoft.DirectX.Direct3D.Surface. A Surface object that represents the source surface to save to a file.
sourcePalette Microsoft.DirectX.Direct3D.PaletteEntry[]. A PaletteEntry array that contains the source palette entries.

Return Value

Microsoft.DirectX.GraphicsStream . A GraphicsStream object that contains the saved surface data.

Remarks

This method handles conversion to and from compressed texture formats.

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


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center