ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Trying to load Thumbnails from Stream in IEMView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Jul 13 2016 :  10:41:27  Show Profile  Reply
Hello,

I want to load thumbnails images that are stored in a SQLite Database in ImageEnMView. But nothing gets loaded

For this I am using this code:

if ZQuery1.RecordCount > 0 then
  begin
    ZQuery1.First;
    while not ZQuery1.Eof do
    begin
      iLayoutId := ZQuery1.FieldValues['lay_id'];
      iThumbnailString := ZQuery1.FieldValues['lay_preview'];
      if Length(Trim(iThumbnailString)) > 0 then
      begin
        ims := TMemoryStream.Create();
        TIdDecoderMIME.DecodeStream(iThumbnailString, ims);
        ims.Seek(0, soFromBeginning);

        iIEBitmap := TIEBitmap.Create;
        iIEBitmap.IELoadFromStream(ims);

        ims.Free;

        idx := iemPageLayoutOptions.AppendImage;

        iemPageLayoutOptions.SetImageFromStream(idx, ims);
        iIEBitmap.Assign(iemPageLayoutOptions.IEBitmap);
        
        iIEBitmap.Free;

      end;  //if Length(Trim(iThumbnailString)) > 0 then
      ZQuery1.Next;
    end; // while not ZQuery1.Eof do
  end; //if ZQuery1.RecordCount > 0 then


I have verified that the image in DB is proper as I am using this same image to load in a StringGrid in another application.

It seems I am making some obvious mistake which I am not able to put my finger on.

Please help me.

TIA


Yogi Yang

xequte

38615 Posts

Posted - Jul 14 2016 :  16:04:26  Show Profile  Reply
Hi Yogi

What is the iIEBitmap code doing? It does not seem to serve any purpose.

Also, you free your memorystream before your call to SetImageFromStream().


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: