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
 IEConvertToThumbnail: Transparent background?

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 - Sep 02 2024 : 02:18:58
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?
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 02 2024 : 17:42:33
Hi Peter

We will look into that in a future version.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Sep 02 2024 : 02:52:41
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.
xequte Posted - Sep 02 2024 : 02:41:19
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