Adding Picture from Dataset graphic field?

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
Mojoala
Posts: 19
Joined: Wed Feb 29, 2012 5:54 pm

Adding Picture from Dataset graphic field?

Post by Mojoala »

Hello everyone.

How do you add a picture from a dataset graphic field?

The help and forum search only shows how to from a load from file perspective.

Thanks in Advance...
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Adding Picture from Dataset graphic field?

Post by larsa »

Hello

Example:

Code: Select all

var
  Pict: TMSOPicture;
begin
  Pict := XLS.MSOPictures.Add;
  // The last parameter is the picture type. 
  // As there id no file extension when reading from a stream
  // you must tell the picture type.
  Pict.LoadFromStream(MyStream,'UniquePictureName',msoblipPNG);
end;
Lars Arvidsson, Axolot Data
Mojoala
Posts: 19
Joined: Wed Feb 29, 2012 5:54 pm

Re: Adding Picture from Dataset graphic field?

Post by Mojoala »

I've never worked with streams, so I need a little help here on how to initiate from a standard TTable or TdataSet.

Thanks in Advance...
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Adding Picture from Dataset graphic field?

Post by larsa »

Hello

Using streams is a very basic thing in delphi. Please ask such questions in a general forum such as Stackoverflow.
Lars Arvidsson, Axolot Data
Post Reply