protected override void WriteData(PsdBinaryWriter writer) { foreach (var channelName in ChannelNames) { writer.WritePascalString(channelName, 1); } }
protected override void WriteData(PsdBinaryWriter writer) { foreach (var channelName in ChannelNames) { writer.WritePascalString(channelName, 1); } }
/// <summary> /// Write out the image resource block: header and data. /// </summary> public void Save(PsdBinaryWriter writer) { writer.WriteAsciiChars(Signature); writer.Write((UInt16)ID); writer.WritePascalString(Name, 2); // Length is unpadded, but data is even-padded var startPosition = writer.BaseStream.Position; using (new PsdBlockLengthWriter(writer)) { WriteData(writer); } writer.WritePadding(startPosition, 2); }
public void Save(PsdBinaryWriter writer) { Debug.WriteLine("Layer Save started at " + writer.BaseStream.Position.ToString(CultureInfo.InvariantCulture)); writer.Write(Rect); //----------------------------------------------------------------------- writer.Write((short)Channels.Count); foreach (var ch in Channels) { ch.Save(writer); } //----------------------------------------------------------------------- writer.WriteAsciiChars("8BIM"); writer.WriteAsciiChars(BlendModeKey); writer.Write(Opacity); writer.Write(Clipping); writer.Write((byte)flags.Data); //----------------------------------------------------------------------- writer.Write((byte)0); //----------------------------------------------------------------------- using (new PsdBlockLengthWriter(writer)) { Masks.Save(writer); BlendingRangesData.Save(writer); var namePosition = writer.BaseStream.Position; // Legacy layer name is limited to 31 bytes. Unicode layer name // can be much longer. writer.WritePascalString(Name, 4, 31); foreach (LayerInfo info in AdditionalInfo) { info.Save(writer); } } }
public void Save(PsdBinaryWriter writer) { writer.Write(Rect); //----------------------------------------------------------------------- writer.Write((short)Channels.Count); foreach (var ch in Channels) ch.Save(writer); //----------------------------------------------------------------------- writer.WriteAsciiChars("8BIM"); writer.WriteAsciiChars(BlendModeKey); writer.Write(Opacity); writer.Write(Clipping); writer.Write((byte)flags.Data); //----------------------------------------------------------------------- writer.Write((byte)0); //----------------------------------------------------------------------- using (new PsdBlockLengthWriter(writer)) { Masks.Save(writer); BlendingRangesData.Save(writer); var namePosition = writer.BaseStream.Position; // Legacy layer name is limited to 31 bytes. Unicode layer name // can be much longer. writer.WritePascalString(Name, 4, 31); foreach (LayerInfo info in AdditionalInfo) { info.Save(writer); } } }