procedure TForm1.Thumbnail1Click(Sender: TObject);
{ Create a thumbnail of a specific size with all objects in a
TImageEnVect and display the thumbnail in another TImageEnVect. }
var
iIEBitmap: TIEBitmap;
begin
iIEBitmap := TIEBitmap.Create(ImageEnVect1.IEBitmap);
try
{ Draw all vectorial objects on the specified TImageEnVect to a bitmap }
ImageEnVect1.DrawObjectsToBitmap(iIEBitmap, True, True);
{ Convert the bitmap to a thumbnail of a specified size with a white border and a shadow, both of which are optional - iexhelperfunctions}
iIEBitmap.IEConvertToThumbnail(240, 120, true, rfNone, True, clWhite, True, 4, 4, clblack, clWhite);
{ Assign the new bitmap to ImageEnVect2 }
ImageEnVect2.IEBitmap.Assign(iIEBitmap);
ImageEnVect2.Update;
finally
iIEBitmap.Free;
end;
end;
This can easily be tested by adding a TButton and name it Thumbnail1 and add a second TImageEnVect to the vectorial demo somewhere on one of the panels. Test it by opening a background image, add some line objects then add the code shown above into the Thumbnail1.OnClick event. When the "Thumbnail" Button is selected, a thumbnail will be created and shown in the second TImageEnVect which will contain the background image and any vectorial objects you add and shown as a thumbnail.
This requires a recent (version 5 or greater) because it utilizes the iexhelperfunctions. The addition of iexhelperfunctions to ImageEn alone, is reason enough for the upgrade of you have a old version of ImageEn. It has a very good set of well tested code that does a lot of things with little code writing required on your part and the number of functions it has increases every few months. Make your life easier... upgrade now! Remember I do not work for ImageEn!
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom Commercial ImageEn Development