Image.FromStream Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an Image from the specified data stream.
FromStream(Stream, Boolean, Boolean) |
Creates an Image from the specified data stream, optionally using embedded color management information and validating the image data. |
FromStream(Stream) |
Creates an Image from the specified data stream. |
FromStream(Stream, Boolean) |
Creates an Image from the specified data stream, optionally using embedded color management information in that stream. |
- Source:
- Image.cs
- Source:
- Image.cs
- Source:
- Image.cs
Creates an Image from the specified data stream, optionally using embedded color management information and validating the image data.
public:
static System::Drawing::Image ^ FromStream(System::IO::Stream ^ stream, bool useEmbeddedColorManagement, bool validateImageData);
public static System.Drawing.Image FromStream (System.IO.Stream stream, bool useEmbeddedColorManagement, bool validateImageData);
static member FromStream : System.IO.Stream * bool * bool -> System.Drawing.Image
Public Shared Function FromStream (stream As Stream, useEmbeddedColorManagement As Boolean, validateImageData As Boolean) As Image
Parameters
- useEmbeddedColorManagement
- Boolean
true
to use color management information embedded in the data stream; otherwise, false
.
- validateImageData
- Boolean
true
to validate the image data; otherwise, false
.
Returns
The Image this method creates.
Exceptions
The stream does not have a valid image format.
The stream does not have a valid image format.
Remarks
The useEmbeddedColorManagement
parameter specifies whether the new Image applies color correction according to color management information that is embedded in the data stream. Embedded information can include International Color Consortium (ICC) profiles, gamma values, and chromaticity information.
הערה
The Image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.
Applies to
.NET 9 (package-provided) וגירסאות אחרות
מוצר | גירסאות |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
- Source:
- Image.cs
- Source:
- Image.cs
- Source:
- Image.cs
Creates an Image from the specified data stream.
public:
static System::Drawing::Image ^ FromStream(System::IO::Stream ^ stream);
public static System.Drawing.Image FromStream (System.IO.Stream stream);
static member FromStream : System.IO.Stream -> System.Drawing.Image
Public Shared Function FromStream (stream As Stream) As Image
Parameters
Returns
The Image this method creates.
Exceptions
The stream does not have a valid image format.
Remarks
You must keep the stream open for the lifetime of the Image.
The stream is reset to zero if this method is called successively with the same stream.
הערה
The Image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.
Applies to
.NET 9 (package-provided) וגירסאות אחרות
מוצר | גירסאות |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
- Source:
- Image.cs
- Source:
- Image.cs
- Source:
- Image.cs
Creates an Image from the specified data stream, optionally using embedded color management information in that stream.
public:
static System::Drawing::Image ^ FromStream(System::IO::Stream ^ stream, bool useEmbeddedColorManagement);
public static System.Drawing.Image FromStream (System.IO.Stream stream, bool useEmbeddedColorManagement);
static member FromStream : System.IO.Stream * bool -> System.Drawing.Image
Public Shared Function FromStream (stream As Stream, useEmbeddedColorManagement As Boolean) As Image
Parameters
- useEmbeddedColorManagement
- Boolean
true
to use color management information embedded in the data stream; otherwise, false
.
Returns
The Image this method creates.
Exceptions
The stream does not have a valid image format.
Remarks
You must keep the stream open for the lifetime of the Image.
The useEmbeddedColorManagement
parameter specifies whether the new Image applies color correction according to color management information that is embedded in the data stream. Embedded information can include International Color Consortium (ICC) profiles, gamma values, and chromaticity information.
The stream is reset to zero if this method is called successively with the same stream.
הערה
The Image class does not support alpha transparency in bitmaps. To enable alpha transparency, use PNG images with 32 bits per pixel.
Applies to
.NET 9 (package-provided) וגירסאות אחרות
מוצר | גירסאות |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
משוב של .NET
.NET הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב: