CreateStream() public abstract méthode

Creates a stream for accessing the surface data.
The returned stream can be used for reading the surface data, and, for some surface formats, to modify the surface data.
public abstract CreateStream ( ) : Stream
Résultat Stream
Exemple #1
0
        private Bitmap SurfaceToBitmap(Surface surface)
        {
            if (surface is JpegSurface)
            {
                var bitmap = new Bitmap(surface.CreateStream());

                SwapRedAndBlueChannels(bitmap);

                return bitmap;
            }
            else
            {
                var bitmap = new Bitmap(surface.Width, surface.Height, PixelFormat.Format32bppArgb);

                try
                {
                    var bitmapData = bitmap.LockBits(new Rectangle(0, 0, surface.Width, surface.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);

                    surface.CopyToArgb(new SurfaceData(bitmapData.Width, bitmapData.Height, bitmapData.Scan0, bitmapData.Stride));

                    bitmap.UnlockBits(bitmapData);

                    return bitmap;
                }
                catch { bitmap.Dispose(); throw; }
            }
        }
Exemple #2
0
 public sealed override Stream CreateStream()
 {
     return(@this.CreateStream());
 }