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