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
 ImageEnMView FillFromDirectory
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

izaque

Brazil
95 Posts

Posted - Jun 29 2012 :  07:59:52  Show Profile  Reply
Hi, I'm having problem to get the image dimensions do ImageEnMView, using the "FillFromDirectory". I am using the following code in version 4.1.0:

ImageEnMView1.FillFromDirectory(sfDialogoTodas.SelectedPathName);
for idx := 0 to ImageEnMView1.ImageCount - 1 do
begin
ImageEnMView1.ImageTopText[idx].Caption := 'Imagem ' + inttostr(idx);
ImageEnMView1.ImageInfoText[idx].Caption := inttostr(ImageEnMView1.ImageWidth[idx]) + ' x ' + inttostr(ImageEnMView1.ImageHeight[idx]);
end;



If I load the image with the "LoadFromFile", the above code works correctly. There is another alternative to the above code to use with "FillFromDirectory"?

w2m

USA
1990 Posts

Posted - Jun 29 2012 :  08:47:53  Show Profile  Reply
When using FillFromDirectory try setting the captions in BeforeImageDraw:

procedure TForm1.ImageEnMView1BeforeImageDraw(Sender: TObject; idx, Left,
  Top: Integer; Canvas: TCanvas);
begin
  ImageEnMView1.ImageTopText[idx].Caption := 'Image ' + inttostr(idx);
  ImageEnMView1.ImageInfoText[idx].Caption := inttostr 
    (ImageEnMView1.ImageOriginalWidth[idx]) + ' x ' + inttostr
    (ImageEnMView1.ImageOriginalWidth[idx]);
end;


When you set the captions right after calling FillFromDirectory not all of the images are loaded yet.

William Miller
Go to Top of Page

izaque

Brazil
95 Posts

Posted - Jun 29 2012 :  09:17:23  Show Profile  Reply
Thank you very much,
worked perfectly!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: