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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Trying to load Thumbnails from Stream in IEMView

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Jul 13 2016 : 10:41:27
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 14 2016 : 16:04:26
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