DefaultRowHeight.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Runtime.InteropServices;
  5. using Biff8Excel.Interfaces;
  6. namespace Biff8Excel.Records
  7. {
  8. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
  9. struct RecordDefaultRowHeight
  10. {
  11. public ushort opcode; //0x225
  12. public ushort length; //0x4
  13. public ushort flags;
  14. public ushort height;
  15. }
  16. //0 0001H 1 = Row height and default font height do not match
  17. //1 0002H 1 = Row is hidden
  18. //2 0004H 1 = Additional space above the row
  19. //3 0008H 1 = Additional space below the row
  20. [FlagsAttribute]
  21. enum EnumDefaultRowFlags :ushort
  22. {
  23. NotMatch = 0x1,
  24. Hidden = 0x2,
  25. SpaceAbove = 0x4,
  26. SpaceBelow = 0x8,
  27. }
  28. public class DefaultRowHeight: IRecords
  29. {
  30. RecordDefaultRowHeight defaultRowHeight;
  31. public DefaultRowHeight()
  32. {
  33. defaultRowHeight.opcode = 0x225;
  34. defaultRowHeight.length = 0x4;
  35. defaultRowHeight.flags = (ushort)EnumDefaultRowFlags.NotMatch;
  36. defaultRowHeight.height = 0x8000;
  37. }
  38. #region IRecords ³ÉÔ±
  39. public byte[] GetByte()
  40. {
  41. return Globals.GetStructToBytes(defaultRowHeight);
  42. }
  43. #endregion
  44. }
  45. }