Recent

Author Topic: A little bug in fpsimages.pas  (Read 2322 times)

wp

  • Hero Member
  • *****
  • Posts: 12873
Re: A little bug in fpsimages.pas
« Reply #15 on: May 22, 2025, 10:57:49 am »
There is a workbook option boWriteZoomFactor which must be included if you want to write the zoom factor to file. To be honest, I cannot remember why I gave this property such a special treatment...
Code: Pascal  [Select][+][-]
  1. program zoom_demo;
  2. uses
  3.   fpspreadsheet, fpsTypes, xlsxOOXML, fpsOpenDocument, xlsbiff8;
  4. var
  5.   book: TsWorkbook;
  6.   sheet: TsWorksheet;
  7. begin
  8.   book := TsWorkbook.Create;
  9.   try
  10.     sheet := book.AddWorksheet('Sheet');
  11.     sheet.WriteNumber(0, 0, 1.0);
  12.     sheet.WriteNumber(0, 1, 2.0);
  13.     sheet.WriteNumber(1, 0, 5.12);
  14.     sheet.ZoomFactor := 2.0;
  15.     book.Options := book.Options + [boWriteZoomFactor];
  16.     book.WriteToFile('zoom.xlsx', true);
  17.     book.WriteToFile('zoom.ods', true);
  18.     book.WriteToFile('zoom.xls', true);
  19.   finally
  20.     book.Free;
  21.   end;
  22. end.

wp

  • Hero Member
  • *****
  • Posts: 12873
Re: A little bug in fpsimages.pas
« Reply #16 on: May 22, 2025, 04:19:23 pm »
Implemented reading of one-cell-anchor images, as well as image rotation angles from xlsx files, based on your patch.

Roni Wolf

  • New Member
  • *
  • Posts: 11
Re: A little bug in fpsimages.pas
« Reply #17 on: May 23, 2025, 08:10:54 pm »
There is a workbook option boWriteZoomFactor which must be included if you want to write the zoom factor to file. To be honest, I cannot remember why I gave this property such a special treatment...
Code: Pascal  [Select][+][-]
  1.     sheet.ZoomFactor := 2.0;
  2.     book.Options := book.Options + [boWriteZoomFactor];
  3.  

Thanks for the explanation! I'm going to change my program to include boWriteZoomFactor in the Workbook options. If I may give you some advice, this option could be enabled by default, since it is normal behavior.  ;)

Implemented reading of one-cell-anchor images, as well as image rotation angles from xlsx files, based on your patch.

 :D :D Thanks! I'm going to check the modified files in svn and include them in my installation. I know there is no forecast for this version to be released in OPM yet, but for now I'm going to use the svn version.

I'm happy to have been able to make a small contribution to this library, which has been very useful to me.

TQVM

Roni

 

TinyPortal © 2005-2018