Author |
Topic |
|
martin
Philippines
10 Posts |
Posted - Apr 07 2014 : 21:44:57
|
How To Display Image directly using ImageEnView component from a TRzFileListBox
I tried using this code but couldn't display the image
ImageEnView1.IO.LoadFromFileJpeg(RzFileListBox1.Items.Strings[i]);
note: *LoadFromFileJpeg just using this because I am selecting jpeg files
thanks
Rizal Martin |
|
Uwe
284 Posts |
Posted - Apr 07 2014 : 21:55:54
|
Martin
My guess: you need to provide a path to your file.
-Uwe |
|
|
martin
Philippines
10 Posts |
Posted - Apr 08 2014 : 01:10:51
|
I'm using TRzFileListBox component which is directly connected to the RzDirectory Tree.
I also tried this ExtractFileName(RzFileListBox1.Items.Strings[i]) but still didn't work
Rizal Martin |
|
|
w2m
USA
1990 Posts |
Posted - Apr 08 2014 : 06:07:41
|
Try this
var
iFilename: string;
begin
iFilename := RzFileListBox1.Items.Strings[i];
if not FileExists(iFilename) then
ShowMessage('The file ' + iFilename + ' does not exist.')
else
begin
ShowMessage('The file ' + iFilename + ' exists. Select Ok to load the file.');
ImageEnView1.IO.LoadFromFileAuto(iFilename);
if ImageEnView1.IO.Aborting = True then
begin
ShowMessage('ImageEn can not open the picture. The picture may be defective.');
end;
end; William Miller Adirondack Software & Graphics Email: w2m@frontiernet.net EBook: http://www.imageen.com/ebook/ Apprehend: http://www.frontiernet.net/~w2m/index.html Custom ImageEn Development |
|
|
martin
Philippines
10 Posts |
Posted - Apr 09 2014 : 00:01:19
|
Thanks w2m.. it worked! good job!
another question have you tried displaying PDF files into the ImageEnMView component or what component should I use?
thanks
Rizal Martin |
|
|
xequte
38608 Posts |
|
martin
Philippines
10 Posts |
Posted - Apr 09 2014 : 05:13:21
|
thanks Nigel
I'll try to read this and apply it.. Is there other way aside using the imagemagick?
Thanks
Rizal Martin |
|
|
Uwe
284 Posts |
Posted - Apr 09 2014 : 07:40:17
|
Martin,
of course there is an alternative: use a simple TWebBrowser to load the PDF.
-Uwe |
|
|
xequte
38608 Posts |
Posted - Apr 10 2014 : 03:11:39
|
Hi Uwe
Yes, this is true, but you need to ensure that Acrobat has been installed on the client.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
Uwe
284 Posts |
Posted - Apr 10 2014 : 07:30:33
|
You're right, Nigel - I forgot to mention that the Acrobat Reader has to be installed on the target system. Although that shouldn't be an issue since most users have the software installed anyway these days. An error check is of course necessary.
-Uwe |
|
|
xequte
38608 Posts |
Posted - Apr 10 2014 : 14:12:39
|
Hi Uwe
Yes, it is rarely a problem. I used this technique to display PDF files in an application in my pre-ImageEn days, and it worked well.
In this case however, he is looking to display thumbnails, which means a third party library such as Ghostscript.
There is also another way, but it would require some work and a paid license from a third party. Email me, Rizal, if you want more info.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
|
|
|
Topic |
|