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
 Simply JOIN two TIEBitmap horizontally or vertically?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

982 Posts

Posted - Dec 24 2022 :  04:50:42  Show Profile  Reply
I have created two TIEBitmap by extracting them with CreateROIBitmap from the same TIEBitmap. Both have the same height. Now I need to JOIN them horizontally seamlessly. Is there a simple method to do this like e.g. JoinBitmaps(LeftBM, RightBM, iejHorz)?

Similarly, I need to join two TIEBitmap (having the same width) vertically, e.g. JoinBitmaps(TopBM, BottomBM, iejVert)?

It would be very helpful if such a simple helper function existed in ImageEn.

xequte

39053 Posts

Posted - Dec 24 2022 :  15:58:21  Show Profile  Reply
Hi Peter

Please use:

http://www.imageen.com/help/IEJoinBitmaps.html


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

982 Posts

Posted - Dec 25 2022 :  03:10:27  Show Profile  Reply
Hi Nigel

Thank you very much!

I wrote a quick and dirty implementation of a "CUTOUT" feature using the IEJoinBitmaps method (I have no Delphi on this computer):

procedure TForm1.ButtonClick(Sender: TObject);
begin
  var SelRect := ImageEnView1.SelectedRect; // TIERectangle
  if (SelRect.height = ImageEnView1.IEBitmap_Height) and // if whole height of the image is selected
     (SelRect.width < ImageEnView1.IEBitmap_Width)       // if less than whole width of the image is selected
  then
  begin
    var modifiedBitmap := TIEBitmap.Create;
    var leftPart := ImageEnView1.IEBitmap.CreateROIBitmap(System.Classes.Rect(0, 0, SelRect.x - 1, SelRect.height - 1));
    var rightPart := ImageEnView1.IEBitmap.CreateROIBitmap(System.Classes.Rect(SelRect.x + SelRect.width, 0,
      ImageEnView1.IEBitmap_Width - 1, SelRect.height - 1));
    iexHelperFunctions.IEJoinBitmaps(modifiedBitmap, LeftPart, RightPart, False);
    ImageEnView1.Assign(modifiedBitmap);
    ImageEnView1.Update;
    FreeAndNil(RightPart);
    FreeAndNil(LeftPart);
    FreeAndNil(modifiedBitmap);
  end;
end;


Is this correct?
Go to Top of Page

xequte

39053 Posts

Posted - Dec 25 2022 :  16:10:13  Show Profile  Reply
Hi Peter

Yes, that looks correct.

FYI, the current beta replaces IEJoinBitmaps() with TIEBitmap.JoinTo().

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: