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
 IEConvertToThumbnail: Transparent background?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

931 Posts

Posted - Sep 02 2024 :  02:18:58  Show Profile  Reply
The IEBitmap helper function ImageEnViewInsertInternal.IEBitmap.IEConvertToThumbnail can be helpful.

However, the parameter cBGColor (the color of the image behind the shadow) is a solid color. How do we make it transparent?

xequte

38586 Posts

Posted - Sep 02 2024 :  02:41:19  Show Profile  Reply
Hi Peter

Unfortunately, that is an old method and should be completely rewritten as it is based on TCanvas rather than TIECanvas, so it does not support things like transparency. I'll look at improving it for a later update.

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

PeterPanino

931 Posts

Posted - Sep 02 2024 :  02:52:41  Show Profile  Reply
I've tried fixing the problem with this code:

var bmp := TIEBitmap.Create(ImageEnView1.IEBitmap);
  try
    // Resize the current bitmap image to 250x250 with a shadow and no border
    bmp.IEConvertToThumbnail(
      250, 250,        // MaxX, MaxY
      True,            // StretchSmall
      rfLanczos3,      // QualityFilter
      False,           // bAddBorder
      clBlack,         // cBorderColor
      TRUE,            // bAddShadow
      5,               // iBlurRadius
      1,               // iShadowOffset
      clBlack,         // cShadowColor
      clFuchsia);      // cBGColor

    bmp.SetTransparentColors(clFuchsia, clFuchsia, 0);
    ImageEnView1.IEBitmap.Assign(bmp);
    ImageEnView1.Update;
  finally
    bmp.Free;
  end;


However, it does not work because the shadow color overlaps the Fuchsia color.

Is it possible to make the cBGColor transparent despite the shadow or to make the whole shadow semi-transparent?

By the way, a "Buttonize" effect would be helpful, where the thumbnail looks like a button with 3-dimensional beveled edges.
Go to Top of Page

xequte

38586 Posts

Posted - Sep 02 2024 :  17:42:33  Show Profile  Reply
Hi Peter

We will look into that in a future version.

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