Author |
Topic  |
|
wesleybobato
  
Brazil
367 Posts |
Posted - Apr 13 2013 : 05:22:45
|
Hello William could help me? ImageEn in VERSION 4.3.0 unit iexShellThumbnails was added to the following method ExtractExplorerThumbnail (...); So I try to put Use. TImageEnMView1.AppendImage; ExtractExplorerThumbnail ('sFilepath', TImageEnMView1.Bitmap); However it does not work can you help me how to use this method of this new unit
thank you again.
|
|
w2m
   
USA
1990 Posts |
Posted - Apr 13 2013 : 07:32:22
|
This only extracts a thumbnail from the first frame of a video file I believe. Are you trying to get a thumbnail from a video file or from a jpg, png or tif or other file format?
William Miller |
 |
|
wesleybobato
  
Brazil
367 Posts |
Posted - Apr 13 2013 : 07:58:14
|
Hello I'm trying William Getting a thumbnail of a video file, AVI, MPEG, MPG, MP4 ....
But I did not understand how I capture the thumbnail and add the TImageEnMView.
you know how this works? |
 |
|
w2m
   
USA
1990 Posts |
Posted - Apr 13 2013 : 08:32:54
|
This works for me...
procedure TForm1.Open1Click(Sender: TObject);
{ Extract Explorer Thumbnail. }
var
iFilename: string;
begin
OpenPictureDialog1.Filter := '';
OpenPictureDialog1.Filter := OpenPictureDialog1.Filter + 'AVI Video (*.avi)|*.avi|';
if OpenPictureDialog1.Execute then
begin
if FileExists(OpenPictureDialog1.FileName) then
begin
iFilename := OpenPictureDialog1.FileName;
if HasExplorerThumbnail(iFilename) then
begin
if ExtractExplorerThumbnail(iFilename, ImageEnView1.Bitmap, 170, 120) then
begin
ImageEnView1.Update;
StatusBar1.Panels[0].Text := EllipsifyText(True, ExtractFileDir(iFilename), Canvas,
StatusBar1.Panels[0].Width);
StatusBar1.Panels[1].Text := EllipsifyText(False, ExtractFileName(iFilename), Canvas,
StatusBar1.Panels[1].Width);
StatusBar1.Panels[2].Text := 'Width: ' + IntegerToString(ImageEnView1.Bitmap.Width);
StatusBar1.Panels[3].Text := 'Height: ' + IntegerToString(ImageEnView1.Bitmap.Height);
end
else
begin
TaskDialog1.Caption := 'Unable To Extract Explorer Thumbnail';
TaskDialog1.Text := ' Unable to extract explorer thumbnail from ' + iFilename + ' file.';
TaskDialog1.ExpandedText := 'Not all video files contain an explorer thumbnail, but typically video files captured by video cameras have an explorer thumbnail.';
TaskDialog1.Execute;
end;
end
else
begin
TaskDialog1.Caption := 'No Explorer Thumbnail';
TaskDialog1.Text := 'The file ' + iFilename + ' does not have an explorer thumbnail.';
TaskDialog1.Execute;
end;
end;
end;
end; William Miller Email: w2m@frontiernet.net EBook: http://www.imageen.com/ebook/ Apprehend: http://www.frontiernet.net/~w2m/index.html |
 |
|
wesleybobato
  
Brazil
367 Posts |
Posted - Apr 13 2013 : 10:09:17
|
Thank You For Your Help William again. Good weekend for you a big hug. |
 |
|
wesleybobato
  
Brazil
367 Posts |
|
w2m
   
USA
1990 Posts |
Posted - Apr 13 2013 : 11:52:20
|
procedure TForm1.Button1Click(Sender: TObject);
{ Extract Explorer Thumbnail. }
var
iFilename: string;
iIndex: integer;
iBitmap: TBitmap;
begin
OpenPictureDialog1.Filter := '';
OpenPictureDialog1.Filter := OpenPictureDialog1.Filter + 'AVI Video (*.avi)|*.avi|';
if OpenPictureDialog1.Execute then
begin
if FileExists(OpenPictureDialog1.FileName) then
begin
iFilename := OpenPictureDialog1.FileName;
if HasExplorerThumbnail(iFilename) then
begin
iBitmap := TBitmap.Create;
try
if ExtractExplorerThumbnail(iFilename, iBitmap, 170, 120) then
begin
iIndex := ImageEnMView1.AppendImage;
ImageEnMView1.SetImage(iIndex, iBitmap);
ImageEnView1.Update;
UpdateGUI;
UpdateStatusbar;
end
else
begin
TaskDialog1.Caption := 'Unable To Extract Explorer Thumbnail';
TaskDialog1.Text := ' Unable to extract explorer thumbnail from ' + iFilename +
' file.';
TaskDialog1.ExpandedText :=
'Not all video files contain an explorer thumbnail, but typically video files captured by video cameras have an explorer thumbnail.';
TaskDialog1.Execute;
end;
finally
iBitmap.Free;
end;
end
else
begin
TaskDialog1.Caption := 'No Explorer Thumbnail';
TaskDialog1.Text := 'The file ' + iFilename + ' does not have an explorer thumbnail.';
TaskDialog1.Execute;
end;
end;
end;
end; William Miller Email: w2m@frontiernet.net EBook: http://www.imageen.com/ebook/ Apprehend: http://www.frontiernet.net/~w2m/index.html |
 |
|
wesleybobato
  
Brazil
367 Posts |
Posted - Apr 13 2013 : 11:55:51
|
Thank you William for his help. |
 |
|
xequte
    
39053 Posts |
Posted - Apr 13 2013 : 14:56:16
|
Hi Wesley
Also, remember that if you are appending a video to a TImageEnMView then you don't need to use ExtractExplorerThumbnail, as the component will do it for you:
// Add some videos to a TImageEnMView (and show their explorer thumbnails) ImageEnMView1.AppendImage('C:\A Video.mpeg'); ImageEnMView1.AppendImage('C:\A second Video.mpeg'); ImageEnMView1.AppendImage('C:\Another Video.avi');
If this is not working then check your values for iegMViewExplorerThumbnailExts:
http://www.imageen.com/help/iegMViewExplorerThumbnailExts.html
Nigel Xequte Software www.xequte.com nigel@xequte.com |
 |
|
wesleybobato
  
Brazil
367 Posts |
Posted - Apr 13 2013 : 16:15:43
|
hello nigel thanks for the tip! I'll add in my project here this method to load the video here.
Good Weekend a big hug. |
 |
|
xequte
    
39053 Posts |
Posted - Apr 14 2013 : 16:58:40
|
Sorry Wesley,
I have been reminded (Thanks Bill) that video thumbnail support is only available when thumbnails are loaded on demand (not possible with append). 
For the next release video thumbnails will also be supported for AppendImage when StoreType=ietThumb.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
|
Topic  |
|