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
 Thumbnail from TImageEnVect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HeinzPo

8 Posts

Posted - May 02 2014 :  16:23:02  Show Profile  Reply
Hello,

I am looking for a way to make a thumbnail from TImageEnVect which is cropped and has some lines with arrows on it.

How can I make a thumbnail of this modified image?

w2m

USA
1990 Posts

Posted - May 02 2014 :  17:01:20  Show Profile  Reply
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
Go to Top of Page

HeinzPo

8 Posts

Posted - May 03 2014 :  10:49:08  Show Profile  Reply
Perfect - thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: