CrystalMpq.DataFormats.Surface.CopyToArgb C# (CSharp) Метод

CopyToArgb() публичный Метод

Copies the contents of the surface to a buffer of same dimensions.
The destination buffer should use the ARGB format represented by ArgbColor. Some basic checks will be done to disallow invalid buffer informations. However, it is the responsibility of the caller to provide a valid destination buffer.
The dimensions of the buffer specified by do not match those of the surface. The stride in does not match the width.
public CopyToArgb ( SurfaceData surfaceData ) : void
surfaceData SurfaceData Information on the destination buffer.
Результат void
        public void CopyToArgb(SurfaceData surfaceData)
        {
            if (surfaceData.Width != width || surfaceData.Height != height) throw new ArgumentException();
            if (surfaceData.Stride < sizeof(uint) * surfaceData.Width) throw new InvalidOperationException();

            CopyToArgbInternal(surfaceData);
        }

Usage Example

Пример #1
0
        public unsafe ArgbSurface(Surface surface)
            : base(surface)
        {
            data = new byte[sizeof(uint) * Width * Height];

            fixed (byte* dataPointer = data)
                surface.CopyToArgb(new SurfaceData(Width, Height, (IntPtr)dataPointer, sizeof(uint) * Width));
        }
All Usage Examples Of CrystalMpq.DataFormats.Surface::CopyToArgb