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 Image from Selection

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
izaque Posted - Oct 17 2012 : 11:31:50
How can I create an image file starting from a selected image with TImageEnView or another ... TImage?
7   L A T E S T    R E P L I E S    (Newest First)
izaque Posted - Oct 22 2012 : 09:14:31
Perfect, thank you!
w2m Posted - Oct 22 2012 : 06:53:11
After you make a selection, press and hold down the SHIFT key, then make another selection. Then use the code provided to save the tif file. After saving you will have one image with both selections with a white background.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
izaque Posted - Oct 22 2012 : 03:57:29
Is there any way to select more than one area of the image and transforms it into a single image starting these selections?
izaque Posted - Oct 19 2012 : 06:11:57
Try this. Thank you very much!
w2m Posted - Oct 18 2012 : 09:00:16
Try this:
procedure TForm1.SaveSelection1Click(Sender: TObject);
// Save the selection to a TIFF file
var
  iIEBitmap: TIEBitmap;
  iImageEnIO: TImageEnIO;
  iFilename: string;
begin
  // Test for selection
  if ImageEnView1.Selected then
  begin
    // Create the TIEBitmap to hold the selection
    iIEBitmap := TIEBitmap.Create;
    try
      // Copy the selection to the iIEBitmap
      ImageEnView1.CopySelectionToIEBitmap(iIEBitmap);
      // Create iImageEnIO to save the IEBitmap to a file
      iImageEnIO := TImageEnIO.Create(nil);
      try
        // Set iIEBitmap as the AttachedIEBitmap
        iImageEnIO.AttachedIEBitmap := iIEBitmap;
        // Build the save picture dialog filter
        SavePictureDialog1.Filter := '';
        SavePictureDialog1.Filter := SavePictureDialog1.Filter + 'TIF Bitmap (*.tif; *.tiff)|*.tif;*.tiff|';
        SavePictureDialog1.FilterIndex := IEFileTypeToGraphicFilterIndex(ImageEnView1.IO.Params.FileType);
        SavePictureDialog1.FileName := 'Selection.tif';
        SavePictureDialog1.DefaultExt := '.tif';
        SavePictureDialog1.Title := 'Save Selection As- ' + SavePictureDialog1.FileName;
        if SavePictureDialog1.Execute then
        begin
          if SavePictureDialog1.FileName <> '' then
          begin
            Screen.Cursor := crHourGlass;
            try
              iFilename := SavePictureDialog1.FileName;
              // Set the file type as TIFF
              iImageEnIO.Params.FileType := ioTIFF;
              // Show the IOPreviews Dialog
              if iImageEnIO.DoPreviews([ppAUTO]) then
                // Save the iIEBitmap as a TIFF
                iImageEnIO.SaveToFileTIFF(iFilename);
                // Deselect the selection
                ImageEnView1.DeSelect;
            finally
              Screen.Cursor := crDefault;
            end;
          end;
        end;
      finally
        // Free iImageEnIO
        iImageEnIO.Free;
      end;
    finally
      // Free iIEBitmap
      iIEBitmap.Free;
    end;
  end
  else
  begin
    MessageDlg('Please make a selection.', mtWarning, [mbOK], 0);
  end;
end;


William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
izaque Posted - Oct 18 2012 : 04:06:53
Exactly, I need to select an image, and this selected part want to generate another image, more precisely in TIFF (Selected_image.tif).
xequte Posted - Oct 17 2012 : 21:44:07
Sorry, I'm not quite following.

Do you mean when you select a portion of the image displayed in a TImageEnView, you want to save that part to a file?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com