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
 Save a part of selected image to another file
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

fabiotesla

Italy
10 Posts

Posted - Jun 26 2015 :  05:42:17  Show Profile  Reply
I wanted to know how to save the contents of a selected image in a new image (ie save a new image with only the selected part).

w2m

USA
1990 Posts

Posted - Jun 26 2015 :  08:34:28  Show Profile  Reply
{Uses iexHelperFunctions}
procedure TForm1.Save1Click(Sender: TObject);
var
  iBitmap: TBitmap;
begin
  if SavePictureDialog1.Execute then
  begin
    if ImageEnView1.Selected then
    begin
      iBitmap := TBitmap.Create;
      try
        ImageEnView1.CopySelectionToBitmap(iBitmap, False);
        iBitmap.IESaveToFile(SavePictureDialog1.FileName, 100);
      finally
        iBitmap.Free;
      end;
    end
    else
      ImageEnView1.IO.SaveToFile(SavePictureDialog1.FileName);
  end;
end;

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

fabiotesla

Italy
10 Posts

Posted - Jun 26 2015 :  09:53:13  Show Profile  Reply
Perfect. It works great. Thanks.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: