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
 iexShellThumbnails - Help
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  05:22:45  Show Profile  Reply
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  Show Profile  Reply
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
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  07:58:14  Show Profile  Reply
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?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 13 2013 :  08:32:54  Show Profile  Reply
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
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  10:09:17  Show Profile  Reply
Thank You For Your Help William again.
Good weekend for you a big hug.
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  10:15:01  Show Profile  Reply
William here in this link which talks about the launch of ImageEn 4.3, shows this method being used in a TImageEnMView is this possible??

http://www.imageen.com/ieforum/topic.asp?TOPIC_ID=896
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 13 2013 :  11:52:20  Show Profile  Reply
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
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  11:55:51  Show Profile  Reply
Thank you William for his help.
Go to Top of Page

xequte

39053 Posts

Posted - Apr 13 2013 :  14:56:16  Show Profile  Reply
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
Go to Top of Page

wesleybobato

Brazil
367 Posts

Posted - Apr 13 2013 :  16:15:43  Show Profile  Reply
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.
Go to Top of Page

xequte

39053 Posts

Posted - Apr 14 2013 :  16:58:40  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: