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
 Last thumb not active after FillFromDirectory

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
Sybren Posted - Aug 21 2012 : 03:41:33
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?
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 23 2012 : 02:00:26
Thanks, I will investigate.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Sybren Posted - Aug 22 2012 : 22:56:14
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?
xequte Posted - Aug 22 2012 : 20:48:11
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
Sybren Posted - Aug 22 2012 : 02:41:35
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.
w2m Posted - Aug 21 2012 : 08:57:00
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