Problem with images

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
PascalD
Posts: 2
Joined: Fri Jan 17, 2014 7:39 pm

Problem with images

Post by PascalD »

I am trying to add an images to a sheet while migrating a project from V1 to V5.

I used the following line to add the image:

Code: Select all

  _Image := _XLS[0].Drawing.InsertImage(_FileName, j, k + 1, 0, 0, 1);
The code freezes in TXLSDrawing.DoInsertImage in the following loop

Code: Select all

  while (AWidth - FColumns[ACol].PixelWidth) >= 0 do begin
    Dec(AWidth,FColumns[ACol].PixelWidth);
    Inc(ACol);
  end;
because FColumns[ACol].PixelWidth is always zero.

Am I missing something ?

Thanks,

Pascal

Delphi XE5 with XLSReadWrite version 5.20.12
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem with images

Post by larsa »

Hello

Please try with the latest update, 5.20.13
Lars Arvidsson, Axolot Data
PascalD
Posts: 2
Joined: Fri Jan 17, 2014 7:39 pm

Re: Problem with images

Post by PascalD »

It works fine now.

Thanks
rjvanvliet
Posts: 17
Joined: Fri Feb 01, 2013 8:24 pm

Re: Problem with images

Post by rjvanvliet »

Hello,

Latest version gives me problems again inserting images! Previous version it works well.

Regards,
RJ
flls
Posts: 13
Joined: Fri Feb 07, 2014 8:58 pm

Re: Problem with images

Post by flls »

When I insert an image does not appear in TXLSSpreadSheet component. When I open the spreadsheet in Excel, the following text appears in place of the image:
Unable to display this image at the time.
The same problem occurs with "Advanced_Invoice" sample that came with the component.


XLSSpreadSheet V2.00.05
SLXReadWriteII V5.20.14a
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem with images

Post by larsa »

Hello

Please try the latest update.
Lars Arvidsson, Axolot Data
flls
Posts: 13
Joined: Fri Feb 07, 2014 8:58 pm

Re: Problem with images

Post by flls »

larsa wrote:Hello

Please try the latest update.
Thank you, the picture appeared in the new version, but it is not anchored in the cell. When we roll the screen in the component, the image is always above the screen in the same position. When I open the spreadsheet in Excel, the image is anchored properly and scrolls along the cell.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem with images

Post by larsa »

Hello

It seems that you not is using the latest update. Please make sure that you don't have any old version lying around. Also, delete all DCU:s as delphi may use these.
Lars Arvidsson, Axolot Data
flls
Posts: 13
Joined: Fri Feb 07, 2014 8:58 pm

Re: Problem with images

Post by flls »

I have the latest version, but the image always appears above the TXLSSpreadSheet component, in the same position. Is it a problem in my code for displaying the image? I'm doing the following:

Code: Select all

procedure TPlanAnuncios.LoadPic(const aXLS: TXLSReadWriteII5; const cl, rw, ts: Integer; const FileName: String);
  var
    aSht    : TXLSWorksheet;
    Image   : TXLSDrawingImage;
  begin
    aSht              := aXLS.Sheets[ts];
    Image             := aSht.Drawing.InsertImage(Filename, cl, rw, 0.05, 0.1, 0.69336);
    Image.Positioning := TDrwOptImagePositioning.doipMoveButDoNotSize;
  end;
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem with images

Post by larsa »

Hello

Is the image not scrolled? There is a error when scrolling with the mouse wheel. This will be fixed in the next update. Otherwise I can't find any errors in your code.
Lars Arvidsson, Axolot Data
flls
Posts: 13
Joined: Fri Feb 07, 2014 8:58 pm

Re: Problem with images

Post by flls »

This is exactly the problem occurs when I use the mouse wheel, there was no attempt to do so before. Thanks, I'll be awaiting the next version with the fix.
Post Reply