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
 How to extract some images from ImageEnFolderMView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mmiranda

Chile
13 Posts

Posted - Jan 15 2014 :  11:22:04  Show Profile  Reply
Hello,

I'm trying "TImageEnFolderMView" but I would like to know how to extract thumbnail images, especially when show large icons of unknown files such as Windows Explorer.

(CopyThumbnailImage to TImage or TImageEnView)

thanks

w2m

USA
1990 Posts

Posted - Jan 15 2014 :  12:22:59  Show Profile  Reply
Open the FolderMView demo in the ..\Multi\FolderMView samples folder.
Add a TCheckBox next to the show preview checkbox at the bottom of the form adjacent to the ShowPreview checkbox. Give the checkbox a name of Thumbnail1. Add hyieutils, iexHelperFunctions to implementation uses.

Then replace the code in the tmrUpdatePreviewTimer event with:
procedure TForm1.tmrUpdatePreviewTimer(Sender: TObject);
var
  iMaxX: Integer;
  iMaxY: Integer;
  iCanStretch: Boolean;
  iQualityFilter: TResampleFilter;
  iAddBorder: Boolean;
  iBorderColor: TColor;
  iAddShadow: Boolean;
  iBlurRadius: Integer;
  iShadowOffset: Integer;
  iShadowColor: TColor;
  iBackgroundColor: TColor;
  iIEBitmap: TIEBitmap;
begin
  tmrUpdatePreview.Enabled := False;
  if chkPreview.checked = False then
    ImageEnView1.Blank
  else if ImageEnView1.IO.Params.Filename <> IEFolderMView.SelectedFilename then
  begin
    if IEFolderMView.SelectedFilename = '' then
      ImageEnView1.Blank
    else
    begin
      { Set the thumbnail parameters }
      iMaxX := ImageEnView1.ClientWidth;
      iMaxY := ImageEnView1.ClientHeight;
      iCanStretch := False;
      iQualityFilter := rfLanczos3;
      iAddBorder := True;
      iBorderColor := clWhite;
      iAddShadow := True;
      iBlurRadius := 4;
      iShadowOffset := 4;
      iShadowColor := clBlack;
      iBackgroundColor := clWhite;
      { If thumbnail is checked then get the image from IEFolderMView and
        convert it to a thumbnail.  Assign the thumbnail to ImageEnView1 and
        update ImageEnView1. Then release the bitmap to prevent memory leak! }
      if Thumbnail1.Checked then
      begin
        iIEBitmap := IEFolderMView.GetTIEBitmap(IEFolderMView.SelectedImage);
        iIEBitmap.IEConvertToThumbnail(iMaxX, iMaxY, iCanStretch,
          iQualityFilter, iAddBorder, iBorderColor, iAddShadow, iBlurRadius,
          iShadowOffset, iShadowColor, iBackgroundColor);
          ImageEnView1.IEBitmap.Assign(iIEBitmap);
        ImageEnView1.Update;
        IEFolderMView.ReleaseBitmap(IEFolderMView.SelectedImage);
      end
      else
      { Load the image from a file }
      begin
        ImageEnView1.IO.LoadFromFile(IEFolderMView.SelectedFilename);
      end;
    end;
  end;
end;

If the show preview checkbox is checked and the thumbnail checkbox is checked, a thumbnail of the selected image will be created and displayed. A thumbnail of System images as well as supported file types will be created. If the thumbnail checkbox is not checked, then the full image will be loaded from disk if the selected image is a supported file type and is not a system image.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page

xequte

39066 Posts

Posted - Jan 16 2014 :  12:34:00  Show Profile  Reply
Hi

Also, you can add the extension to:

http://www.imageen.com/help/TIEImageEnGlobalSettings.MViewExplorerThumbnailExts.html

Even if it is a supported ImageEn image format.



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: