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
 Problem when adding multiple borders

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
PeterPanino Posted - Feb 22 2024 : 11:15:29
I need to add a transparent border around the image and then a solid border around the transparent border:

procedure TForm1.ButtonAddBorderOneClick(Sender: TObject);
begin
  // Add a transparent border around the image:
  ImageEnView1.IEBitmap.Resize(
    ImageEnView1.IEBitmap.Width + 20, ImageEnView1.IEBitmap.Height + 20, clRed, 0, iehCenter, ievCenter );
  ImageEnView1.Update;
end;

procedure TForm1.ButtonAddBorderTwoClick(Sender: TObject);
begin
  // Then add a solid border around the transparent border:
  ImageEnView1.IEBitmap.Resize(
    ImageEnView1.IEBitmap.Width + 20, ImageEnView1.IEBitmap.Height + 20, clBlack, 255, iehCenter, ievCenter );
  ImageEnView1.Update;
end;


However, this has undesired side effects on the transparent areas of the image (including the transparent border)!

Here is a test project demonstrating this:

attach/PeterPanino/2024222111448_BorderTest.zip
76.52 KB

How can this be prevented?
4   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Feb 23 2024 : 16:44:00
Hi Nigel,

Even that does not solve the specific transparency problem.

So, I will wait for the source update.
xequte Posted - Feb 23 2024 : 14:55:53
Sorry, that should have read:

ImageEnView1.IEBitmap.AlphaChannel.SyncFull();
ImageEnView1.Update();

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Feb 23 2024 : 14:44:51
Hi Nigel,

Thanks for your excellent support!

However,
ImageEnView1.IEBitmap.SyncFull() after resizing
does not solve the problem.

So, I will email you for the fixed source.

xequte Posted - Feb 22 2024 : 19:27:30
Thanks Peter

I have fixed this in the current beta. You can email me for it, or call ImageEnView1.IEBitmap.SyncFull() after resizing.

Nigel
Xequte Software
www.imageen.com