Creating a Yosemite shadow for borderless form in Delphi [part 3]
In this part we are going to use the shadow form from out project source code and main form.
0:28 vhanla
In this part we are going to use the shadow form from out project source code and main form.
0:26 vhanla
Now that we have our shadow picture, it is time to create our project, so with no further ado let’s create a new VCL Form application in Delphi, and add another VCL form, that will be our shadow form which will be an alpha layered window, that’s because we will use the main form as the content holder, and VCL controls are not compatible with alpha layered windows, neither can be translucent, so that’s why we need two forms.
For the sake of small footprint of the pictures, I cropped them to 252x252 resulting in the following:
Name the second form as frmShadow and then add those two pictures as resources: Project->Resources and images
0:25 vhanla
Long time ago I wrote a blog post here, about creating a Metro like application, it was an interesting research process, I’ve learned a lot, but there was left the shadow, since CS_DROPSHADOW was not exactly the shadow that normal windows show.
So today, I’m going to write another method that basically will use another form as a shadow due to alpha layered requirement to draw alpha channel pictures, hence this will be the shadow of our program.
I have decided that this program will use the OSX Yosemite’s shadow, for the sake of the fun.
This was an easy task (I tried to write a reverse alpha mask finder tool), I just created a rectangle with an specific color, moved a Yosemite window over this rectangle, captured a snapshot to a PNG file, in order to process them (two: active and inactive shadows), so I could find out the original alpha mask, and then convert it to a ARGB PNG file to use in our program as the shadow.
Tools I have used: Imagemagick and a picture editor (Photofiltre in my case).
This is the picture, using a background picture with the #B100B2 color.