DefaultColWidth.cs 1004 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 RecordDefaultColWidth
  10. {
  11. public ushort opcode; //0x55
  12. public ushort length; //0x2
  13. public ushort width; //0xA;
  14. }
  15. internal class DefaultColWidth : IRecords
  16. {
  17. RecordDefaultColWidth defaultcolwidth;
  18. public DefaultColWidth()
  19. {
  20. defaultcolwidth.opcode = 0x55;
  21. defaultcolwidth.length = 0x2;
  22. //The default width of 8 set in this record results in a column width of 8.43 using Arial font with a size of 10 points.
  23. defaultcolwidth.width = 0xA;
  24. }
  25. #region IRecords ³ÉÔ±
  26. public byte[] GetByte()
  27. {
  28. return Globals.GetStructToBytes(defaultcolwidth);
  29. }
  30. #endregion
  31. }
  32. }