Recent

Author Topic: How to add a border and a shadow drop to TBCRoundedImage (feature request?)  (Read 877 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 765
  • Tweaking4All.com
    • Tweaking4All
Been tinkering for a bit now to get a image, with rounded corners, a thin border, and a shadow drop.
Ideally in such a way that I can reuse the code, and that it can handle resizing or changing border width.

Have tried numerous options (including one from a German Lazarus forum, based on this post) now and just cannot seem to get it right.
Yes I can get it right under very specific, one-time use only, situations.
Things just go wrong when images are resized (eg. rounded corners not fitting etc).

I tried several combinations of RoundRectAntialias and FillRoundRectAntialias, just couldn't get it consistently to be "right" when resizing (again: one time use for one specific situation works, just not in a flexible way).

I also tried TBCRoundedImage, which does the job to create a rounded corner image, just have not been able to get a shadow drop and border to work properly.

Can I ask this as a feature request?
Or am I overlooking something in the BGRAControls/BGRABitmap documentation?

lainz

  • Hero Member
  • *****
  • Posts: 4742
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Hi, if you can access the wiki there are examples on how to use masks.

https://wiki.freepascal.org/BGRABitmap_tutorial_5

In bgracontrols there is test_mddrawings with a circle and a rounded rectangle with shadow.

Hansaplast

  • Hero Member
  • *****
  • Posts: 765
  • Tweaking4All.com
    • Tweaking4All
Thanks Lainz for chiming in!


Will look into this one right away 😊

 

TinyPortal © 2005-2018