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
 Problem when adding multiple borders
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Feb 22 2024 :  11:15:29  Show Profile  Reply
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?

xequte

38592 Posts

Posted - Feb 22 2024 :  19:27:30  Show Profile  Reply
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
Go to Top of Page

PeterPanino

933 Posts

Posted - Feb 23 2024 :  14:44:51  Show Profile  Reply
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.

Go to Top of Page

xequte

38592 Posts

Posted - Feb 23 2024 :  14:55:53  Show Profile  Reply
Sorry, that should have read:

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

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

PeterPanino

933 Posts

Posted - Feb 23 2024 :  16:44:00  Show Profile  Reply
Hi Nigel,

Even that does not solve the specific transparency problem.

So, I will wait for the source update.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: