CrystalMpq.DataFormats.ArgbColor.CopyOpaque C# (CSharp) Method

CopyOpaque() static private method

Copies an ArgbColor into another, with forced opaque alpha.
static private CopyOpaque ( ArgbColor destination, ArgbColor source ) : void
destination ArgbColor The destination color.
source ArgbColor The source color.
return void
        internal static unsafe void CopyOpaque(ArgbColor* destination, ArgbColor* source)
        {
            destination->B = source->B;
            destination->G = source->G;
            destination->R = source->R;
            destination->A = 255;
        }

Usage Example

示例#1
0
        private unsafe void CopyToArgbOpaque(SurfaceData surfaceData)
        {
            int rowLength = Width;

            fixed(byte *dataPointer = data)
            fixed(ArgbColor * palettePointer = palette)
            {
                byte *destinationRowPointer = (byte *)surfaceData.DataPointer;
                byte *sourcePointer         = dataPointer;

                for (int i = Height; i-- != 0; destinationRowPointer += surfaceData.Stride)
                {
                    ArgbColor *destinationPointer = (ArgbColor *)destinationRowPointer;

                    for (int j = Width; j-- != 0;)
                    {
                        ArgbColor.CopyOpaque(destinationPointer++, palettePointer + *sourcePointer++);
                    }
                }
            }
        }