Author |
Topic |
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 03:03:30
|
I am having problems displaying the image in the thumbs. I load it using file as follows:
InsertImage( n ); ImageFileName[ n ] := filename;
I also load the same image in a TImageEnView, but after modifying it in TImageEnView, I can't seem to update the thumb image in the TImageEnMView. How do I do this?
I have also disabled EnableAdjustOrientation, but the thumbs do not display the real orientation of the file.
Please help.
Thanks |
|
fab
1310 Posts |
Posted - Jul 30 2011 : 03:35:38
|
Setting ImageFileName[] makes ImageEn to reload the image whenever necessary, from the original file. So if you change the loaded image has no effect (the image will be reloaded from the original source).
You should actually load the image with:
ImageEnMView.InsertImage(n);
ImageEnMView.SetImageFromFile(n, filename);
EnableAdjustOrientation should be True to automatically rotate images which have orientation info stored. |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 07:39:20
|
I am still getting the image wrong in the thumbs. The TImageEnView shows the modified version of the actual file, but the thumbs still do not refresh. Is there a cache that I need to reset since the thumbs still load the same "old" image of the file and nothing I do refreshes it.
Please help.
Thanks. |
|
|
fab
1310 Posts |
Posted - Jul 30 2011 : 07:54:55
|
Please let me know how you modify the image. |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 08:06:42
|
I save the index and the image file to global variables like this:
idx := ImageEnMView1.SelectedImage; fn := ImageEnMView1.ImageFileName[ idx ];
Then I would load the image elsewhere in the program with a TImageEnView in the OnDblClick event of the TImageEnMView;
ImageEnView1.Blank; ImageEnView1.IO.LoadFromFile( fn ); ImageEnView1.Update;
I would do some things like deskew or rotate and save back to the file:
ImageEnView1.IO.SaveToFile( fn );
Then I try updaing the thumb in the TImageEnMView:
ImageEnMView1.ReloadImage( idx ); ImageEnMView1.ImageFileName[ idx ];
But the thumb load the image before the changes. I would exit and load the file back to the TImageEnMView and it still shows the image before the changes. But the TImageEnView shows the correct changed image when I load the file.
Please help.
Thanks.
|
|
|
fab
1310 Posts |
Posted - Jul 30 2011 : 08:11:36
|
This could happen because ImageEn loads the EXIF thumbnail instead of the full image. Just calling SaveToFile doesn't update also the EXIF thumbnail.
Please replace...
ImageEnView1.IO.SaveToFile( fn );
...with...
ImageEnView1.IO.Params.UpdateEXIFThumbnail(); ImageEnView1.IO.SaveToFile( fn );
Or disable EXIF thumbnails loading:
ImageEnMView1.EnableLoadEXIFThumbnails = false; |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 08:22:56
|
This helps a little in that when I reload the images into the TImageEnMView, the correct changed image is shown in the thumb. But how do I "refresh" the image in the thumb on-the-fly right after modifying the image without having to reload all the images back into the TImageEnMView?
Currently the following did nothing to refresh after saving:
ImageEnMView1.ReloadImage( idx ); ImageEnMView1.UpdateImage( idx ); ImageEnMView1.ImageFileName[ idx ] := fn;
Please help.
Thanks.
|
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 08:44:14
|
I spoke too soon. I managed to update the image using the following:
ImageEnMView1.ImageFileName[ idx ] := fn; ImageEnMView1.ReloadImage( idx );
Is this the good way?
Thanks very much for the help. |
|
|
fab
1310 Posts |
Posted - Jul 30 2011 : 08:48:37
|
I should be enough to call just ReloadImage. ImageFileName[] is already assigned. |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 09:15:54
|
Thanks very much. I do have a couple of requests for TImageEnMView and I don't mind paying for it:
1. Auto Scroll when dragging a thumb away from the view (I am using one column grid style of images) like to the top or bottom
2. Checkboxes.
What is the best way to drag n' drop thumb from within the same TImageEnMView? Any help is greatly appreciated.
Thanks again.
BTW, upgrading to version 4.0 today. No code breaking when recompiling existing projects?
|
|
|
fab
1310 Posts |
Posted - Jul 30 2011 : 09:35:01
|
>1. Auto Scroll when dragging a thumb away from the view (I am using one column grid >style of images) like to the top or bottom
It will be included (I hope) when will be possible to move thumbnails with the mouse. This feature is already in the plans.
>2. Checkboxes.
Please look at multipage\customthumbs2 (of version 4.0.0). It is not very automatic, yet, but it works.
>What is the best way to drag n' drop thumb from within the same TImageEnMView? >Any help is greatly appreciated.
Please look at dragdrop\multiview2 example. Anyway an full automatic version will be available (see question 1).
>BTW, upgrading to version 4.0 today. No code breaking when recompiling existing projects?
Not that I know of. However as all software upgrades this can happen. |
|
|
AndyColmes
USA
351 Posts |
Posted - Jul 30 2011 : 09:44:14
|
Thank you Fabrizio.
Upgraded to 4.0. just now. |
|
|
|
Topic |
|