Load image from Stream and insert to XLS

Questions and answers on how to use XLSSpreadSheet.
Post Reply
MaxChan
Posts: 19
Joined: Sat Sep 03, 2016 6:38 am

Load image from Stream and insert to XLS

Post by MaxChan »

Dear Support,

I am able to load the image and insert into XLS SHEET.
var Image: TXLSDrawingImage;
Image := XSS.XLS[0].Drawing.InsertImage( 'resource\psd-icon.png' ,1,1,0,0,1.25);

But I tried to use TMemoryStream it have error.

Do you have an example that load from stream?

thank you very much!
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Load image from Stream and insert to XLS

Post by larsa »

Hello

You are trying to read a file from "resource\psd-icon.png" as the stream is missing in the call to InsertImage.
Use:

Code: Select all

Image := XSS.XLS[0].Drawing.InsertImage( 'resource\psd-icon.png' ,MyMemoryStream,1,1,0,0,1.25);
Lars Arvidsson, Axolot Data
Post Reply