ImageList promises me Alphablending, but how do I enable it? - delphi

I want my buttons to have images with alphablending on them.
As instructed I've included a TXPManifest component on my mainform.
Below are some images I've loaded into my project.
However my BitBtn, which is linked to the imagelist via an ActionList still looks off.
<<-- It looks like this at runtime, Yikes!
How do I get Delphi 2007 running on my Windows 7 laptop to actually use the alpha channel the ImageList keeps teasing me with?
In response to #RRUZ, here are the imagelist properties:
(Note the absence of a colordepth property)
EDIT
The alpha-blending does work with the TMS AdvGlowButton:
So it's probably not a ImageList issue, as much as it is an BitBtn issue.
UPDATE 2
Downloaded and installed PngComponents. Putting a TPNGImageList on a blank form instantly crashes D2007. (Maybe something in the settings/path/etc, but I'm drifting too far from the original issue so I'm dropping the png pursuit).
So that doesn't work.

I suggest you to refer to Anders Melander's Blog.
Hes has published 2 relevant posts both related to alpha blending under Delphi 2007:
Alpha Blended Splash Screen in Delphi - Part 1
Alpha Blended Splash Screen in Delphi - Part 2
Very instructives.

Related

How to apply an effect on TImage?

This tutorial says that in order to apply an effect to an image, you need to make the effect a child of the MultiResBitmap of that image:
I can't do that. The effect refuses to nest under MultiResBitmap. It remains stuck under Image1:
What am I doing wrong? This should be so simple....
Why does the MultiResBitmap contain the word 'bitmap'? Does it HAVE to contain a bitmap (BMP), or does it also work with JPG?
I am new to Delphi 10.2 Tokyo (and FMX) - I am trialing it for a possible purchase.
I just tested it following the steps in the tutorial, and it works perfectly fine for me. Drag and drop RippleEffect1 onto Image1 (not the multi-res bitmap, but Image1).
The image does not have to be a bitmap; it can be any supported image type. The name choice you'll have to ask Embarcadero about, I'm afraid.

TChart quality issue

We were using Delphi 2010 with the full VCL edition of TeeChart this worked fine
We have now updated to Delphi XE 5 with the latest version of TeeChart and the quality of the charts is now worse
Please see the image here
2 bars which were seperate are now merged into 1 bar
If I make the charts wider which is not an option it looks better but still not as good as before
Please see here
Has anyone come across any issue like this?
The projects are here for Delphi XE5 and here for Delphi 2010
The search paths may need modifying
Cheers
Paul
The issue might be because of the anti-aliasing function being turned on by default in the newer versions of TChart(!).
We had the same issue with a line series graph.
After writing to the vendor (Steema) they came up with the following solution:
Chart1.Canvas := TTeeCanvas3D.Create; //Disable GDI+ to prevent smooth drawing of the graph.
I don't get why we have to switch off drawing with GDI+ as - to my knowledge - GDI+ can also be used without anti-alias.
Anyway, our graphs now behave like the previous versions of the TChart, which is what we want.
I was also hating the "new" anti-aliased charts that are blurry and slow.
It's pretty easy to fix, when you know where to search for.
Double-click on chart, then go to 3D -> Render -> select GDI instead of GDI+
If you look "behind the scenes" into DFM file you can see the change:
Crisp and fast graph (as in 2010): DefaultCanvas = 'TTeeCanvas3D'
Blurry and slow graph (as in XE5): DefaultCanvas = 'TGDIPlusCanvas'
chart settings
Hope this helps.
Some kind of a clumsy runtime workaround was found here, that is also working:
http://www.teechart.net/support/viewtopic.php?f=3&t=15078

Ugly "disabled" images of TMainMenu

Delphi 2010, Win32 VCL. I need to create a main menu for my application with the most standard look. TMainMenu looks nice in all Windows versions, the only bad thing is when it displaying images for items with Enabled=False.
Delphi has some strange method for building that disabled images (b/w extrusion with bevels, for me it looks like spew). I want to make a patch for that procedure in VCL sources and let menu to select disabled images from the same TImageList, but I can't find it.
Is it exists at all or it is some standard windows API call? Do you know where is that procedure located?
Sure OwnerDraw style can fix all this but I want a bit faster solution.
There's a great post on Galfar's Lair blog which describes the problem, and has code for a workaround, overriding the TImageList DoDraw method.
Here's the pic (linked) showing the 'before' and 'after'.
I think this relates to pretty much all Delphi versions.
If you can provide your images as PNG you can use TPngImageList from PngComponents. It has different options to make a blended or grayscaled disabled image. The PNG format allows you to make use of alphablending.

Delphi: image with alpha blending capabilities

Is there some simple component that could display PNG 32-bit images and alpha-blend it to another image on mouse enter and on mouse leave? Or even just a simple image that can load 32-bit PNG and additionally would have Alpha parameter...
I suppose I could use some skin library (alphacontrols?) or some graphics library, but for some simple purely visual effects that would be quite an overkill and I can't seem to find a simple one that does it for me and would work on Glass surface as well...
It is not quite a component, but here is a link to a good article on how to do it yourself. Its just a few lines of code:
http://melander.dk/articles/alphasplash/
The basic TImage is capable of displaying a PNG image and alpha-blend-it to whatever is behind it. You just need to add the "pngimage" unit to the uses clause of your form. You didn't mention the version of Delphi you're on: Delphi 2010 has this unit, but I have no idea with what version of Delphi they started shipping it. For Delphi 7 I know for sure you'll need to find the open source "pngimage".
If you need to do this when the user moves in and out of your control, consider caching the state images in bitmaps: it will be faster at runtime and you can use a single TImage that shows the current image, you don't need two overlapping TIMage controls.

How to make the form into fully transparent 32bit alpha?

i use to create a full transparent form, but the png and the 32bit image will not blend to the form and images is not properly displayed its trnsparency. i get the concept here but i cannot put button on it. all abject are invisible except the image backgound. by the way my compiler is delphi7 and D2009
Seems that Andreas Hausladen stumbled upon a similar problem and has already implemented a solution: he rewrote TJvTransparentForm in the JVCL library.
Even if you are not going to use that component directly you may gain some insight by studying the source.
Here is the link to Andreas' article.
If you want to use a PNG to control transparency you might want to look into "layered windows":
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
UpdateLayeredWindow
This allows you to have variable transparency accross the window, just as PNG allows! The problem is, controls on layered windows don't really work, I guess it's a Windows issue. My solution was to actually brake up the big window into multiple smaller windows, with all the controls on non-layered windows. This creates yet an other problem, because you now have multiple windows and you want them to move like a single window. The solution: implement your own algorithm for moving the window accross the screen and use:
BeginDeferWindowPos
DeferWindowPos
EndDeferWindowPos
... to move all windows at once, so the user has no idea she's looking at multiple windows! Finally, if you want to get fancy, you might want to look into SetWindowRgn: this allows you to create a window with a non-rectangular shape.
P.S: Reading Andrea's link from Uwe Raabe, he's using the same technique, only he packaged it ready for action!

Resources