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
 Last thumb not active after FillFromDirectory
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Sybren

32 Posts

Posted - Aug 21 2012 :  03:41:33  Show Profile  Reply
When I freshly load an ImageEnMView with FillFromDirectory (followed by Update) the thumbnails are correct but I can't click on the last thumbnail in the ImageEnMView. Only after first clicking any other thumbnail it will respond to my selection click. I'm using onImageSelect to see the response of the click and find the idx of that image. I'm working in WinXP, SP2. How can I solve this issue?

w2m

USA
1990 Posts

Posted - Aug 21 2012 :  08:57:00  Show Profile  Reply
I can not duplicate your problem. Here is how I filled ImageEnMView:
procedure TForm1.FillFromDirectory1Click(Sender: TObject);
begin
  if DirectoryExists(FFolder) then
  begin
    ImageEnMView1.Clear;
    ImageEnMView1.FillFromDirectory(FFolder);
    ImageEnMView1.SelectedImage := 0;
    ImageEnView1.IO.LoadFromFile(ImageEnMView1.ImageFileName[0]);
    UpdateGUI;
    UpdateStatusbar;
  end;[
end;


After loading I can select the last thumbnail and it is shown in the ImageEnView:
procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
var
  iFilename: string;
begin
  iFilename := ImageEnMView1.ImageFileName[idx];
  if iFilename = '' then
    iFilename := FFileName;
  if FileExists(iFilename) then
  begin
    Caption := 'ImageEnMView From A To Z- ' + iFilename;
    ImageEnMView1.Hint := iFilename + ' Frame: ' + IntToStr(idx + 1);
    ImageEnView1.IO.Params.ImageIndex := idx;
    Statusbar1.Panels[2].Text := 'Frames: ' + IntToStr(IEGetFileFramesCount(iFilename));
  end;
  ImageEnView1.IEBitmap.Assign(ImageEnMView1.GetTIEBitmap(idx));
  ImageEnMView1.ReleaseBitmap(idx);
  ImageEnView1.Update;
  if Fit1.Checked then
  begin
    ImageEnView1.Fit;
    ImageEnView1.Update;
  end;
  Statusbar1.Panels[3].Text := 'Frame: ' + IntToStr(idx);
end;


William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

Sybren

32 Posts

Posted - Aug 22 2012 :  02:41:35  Show Profile  Reply
Thanks for the prompt reply. I tried your code and it worked just fine. I trimmed it down to the one line that made the difference

ImageEnMView.SelectedImage := 0;

When adding this line to the fill-directory command it all works as expected.
Thanks.
Go to Top of Page

xequte

38611 Posts

Posted - Aug 22 2012 :  20:48:11  Show Profile  Reply
Hi Sybren

For my testing, what was the value of ImageEnMView.SelectedImage before you set it to zero?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

Sybren

32 Posts

Posted - Aug 22 2012 :  22:56:14  Show Profile  Reply
Hi Nigel,

None. It didn't respond to a mouseclick, so the onImageSelect doesn't work. That was the issue actually. I couldn't get any response from the last thumbnail picture, not after I have clicked on any other thumbnail. This was an issue when developing and testing under XP, using Delphi 7. Old but extremely stable

The last thumbnail will however allow for drag and drop, but it will drop the first picture (indx=0), while I have clearly clicked on the last thumbnail. This makes sense: I do drag and drop, but it still has indx = 0 (?) in memory because the indx is not updated with the onImageSelect command of that last thumb. If I drag and drop any other thumb it correctly takes the selected image.

The issue seems to be OS independent, it also happens under W7. My assumption: when the FillFromDirectory is followed by an actual thumb selection command (indx 0) some parameters become 'active' which would otherwise have come active by any actual click. Or to put it differently: all thumbs respond to onImageSelect except the last one, which is only responding after any other thumb is clicked.

Hope this helps?
Go to Top of Page

xequte

38611 Posts

Posted - Aug 23 2012 :  02:00:26  Show Profile  Reply
Thanks, I will investigate.



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: