ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Create individual thumbnail files

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
mvbobj Posted - May 08 2015 : 11:03:48
I have an ImageEnMView component with one or more images in it - I need to save the images as individual files and also save thumbnails of those images as individual files.

Single b&w 1 bit image currently in ImageEnMView1:

ImageEnMView1.StoreType := ietThumb;
ImageEnMView1.ThumbWidth := 116;
ImageEnMView1.ThumbHeight := 150;
ImageEnMView1.ThumbnailDisplayFilter := rfFastLinear;
ImageEnMView1.CopyToIEBitmap(0, ImageEnIO1.IEBitmap);
ImageEnIO1.Params.Assign(ImageEnMView1.MIO.Params[0]);
ImageEnIO1.SaveToFileTIFF('bwThumb.tif');

I get a 22k file that's 816+1066.

What do I need to do here? I just want to take each image and save it to a file and then save a 116x150 thumbnail to another file.
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - May 08 2015 : 12:43:47
Some very good and easy to use functions are in the iexHelperFunctions unit. The functions include IEConvertToThumbnail for Bitmaps and IEBitmaps that quickly produce thumbnails with various effects including border color and shadows.

You can save all the image frames in ImageEnMView as full size tif files along with jpg thumbnails for each:
procedure TForm1.CreateAndSaveAll1Click(Sender: TObject);
var
  i: Integer;
  iIEBitmap: TIEBitmap;
  iFolder: string;
  iTifFilename: string;
  iThumbnailFilename: string;
begin
  for i := 0 to ImageEnMView1.ImageCount - 1 do
  begin
    { Get the full size image from the selected ImageEnMView frame }
    iIEBitmap := ImageEnMView1.GetTIEBitmap(i);
    try
      iFolder := DesktopFolder;
      { Create the tif file filename }
      iTifFilename := iFolder +
        JustName(ImageEnMView1.MIO.Params[i].FileName) + '.tif';
      { Create the jpg thumbnail filename }
      iThumbnailFilename := iFolder +
        JustName(ImageEnMView1.MIO.Params[i].FileName) + '_thumbnail.jpg';
      { Save all images stored in ImageEnMView as full size tif files }
      iIEBitmap.IESaveToFile(iTifFilename, ioTIFF);
      { Convert the full image to a thumbnail }
      iIEBitmap.IEConvertToThumbnail(150, 116, Stretch1.Checked, rfLanczos3,
        AddBorder1.Checked, BorderColor1.Selected, AddShadow1.Checked, 0,
        StrToIntDef(ShadowOffset1.Text, 4), ShadowColor1.Selected,
        BackgroundColor1.Selected);
      { Save all thumbnails as jpg }
      iIEBitmap.IESaveToFile(iThumbnailFilename, ioJPEG);
    finally
      ImageEnMView1.ReleaseBitmap(ImageEnMView1.SelectedImage);
    end;
  end;
end;


A complete demo written with IE 6.0 and XE7 can be downloaded here: http://www.xecute.com/ieforum/topic.asp?whichpage=3&TOPIC_ID=1446#7857

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development