/// <summary> /// Writes a 4-byte <see cref="RGBA"/> value to the data stream. /// </summary> /// <param name="binaryWriter">The current <see cref="BinaryWriter"/> object.</param> /// <param name="bgra">The RGBA value to write.</param> public static void WriteBGRA(this BinaryWriter binaryWriter, BGRA bgra) { binaryWriter.Write(bgra.B); binaryWriter.Write(bgra.G); binaryWriter.Write(bgra.R); binaryWriter.Write(bgra.A); }
/// <summary> /// Reads a 4-byte RGBA value from the data stream. /// </summary> /// <returns>The argument.</returns> /// <param name="binaryReader">binaryReader.</param> public static BGRA ReadBGRA(this BinaryReader binaryReader) { byte B = binaryReader.ReadByte(); byte G = binaryReader.ReadByte(); byte R = binaryReader.ReadByte(); byte A = binaryReader.ReadByte(); BGRA bgra = new BGRA(B, G, R, A); return(bgra); }