7

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.

Imagelist editor

However my BitBtn, which is linked to the imagelist via an ActionList still looks off.

BitBtn is 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:
enter image description here
(Note the absence of a colordepth property)

EDIT
The alpha-blending does work with the TMS AdvGlowButton: AdvGlowButton with alphablending correct
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.

Johan
  • 74,508
  • 24
  • 191
  • 319
  • 2
    Are you setting the property `ColorDepth` of the TimageList to `cd32Bit`? – RRUZ Dec 15 '11 at 21:03
  • @RRUZ, I don't think Delphi-2007 `ImageList` has a ColorDepth property, see the updated question. – Johan Dec 15 '11 at 21:15
  • If it doesn't have the ColorDepth property then you can set `ImageList1.Handle := ImageList_Create(...)`. Then populate the list at runtime by loading icons from resources. That's what I had to do in D6. – David Heffernan Dec 15 '11 at 21:18
  • @DavidHeffernan, it seems to work correct with the TMS controls like AdvGlowButton, so it's likely a BitBtn issue. – Johan Dec 15 '11 at 21:27
  • Does that Delphi have the TButton that supports images? – David Heffernan Dec 15 '11 at 21:27
  • 1
    @DavidHeffernan, just tested, nope no support for images on TButton. – Johan Dec 15 '11 at 21:29
  • The purple background hints the bitmap to be 24bpp. Anyway with an 32bpp bitmap I see black artifact instead of purple. I'm using TPngImageList for D2007 for this kind of stuff, but it may not be possible to find the base library 'pngimage' since it has now long been incorporated into the VCL. – Sertac Akyuz Dec 15 '11 at 21:29
  • 1
    What does TXPManifest got anything to do with it? D2007 already attaches a manifest. – Sertac Akyuz Dec 15 '11 at 21:47
  • @SertacAkyuz, The imagelist editor specifically told me _(see screenshot)_ to include a XPManifest, so I did. – Johan Dec 15 '11 at 21:50
  • @Johan, I guess CN Wizards was lazy to explain version requirement, just checked the manifests, the only differences are assemblyIdentity name, one is "DelphiApplication", the other is "CodeGear RAD Studio", and assemblyIdentity version, one is "1.0.0.0", the other is the actual version of BDS. – Sertac Akyuz Dec 15 '11 at 21:57
  • @SertacAkyuz: `TXPManifest` is a legacy component for old Delphi versions before the `TThemeManager` component logic was rolled into the VCL natively. It does not matter how your app gets a manifest, only that it get compiled with one enabled, and the manifest has to enable ComCtrls v6 (which the default manifest does). – Remy Lebeau Dec 15 '11 at 21:57
  • `TXPManifest` was for Delphi versions that didn't inherently support theming. In D2007, you can use `Project->Options->Application->Enable Themes` (not sure of exact wording; don't have 2007 installed here). There may be a conflict between the manifests that isn't apparent without actually viewing resources. The best solution is *not* to use `TXPManifest`, and enable theme support for the project instead. `CN Wizards` is wrong; it should have mentioned that the note applied to Delphi 7 and earlier. – Ken White Dec 15 '11 at 23:36

1 Answers1

1

I suggest you to refer to Anders Melander's Blog.

Hes has published 2 relevant posts both related to alpha blending under Delphi 2007:

Very instructives.

menjaraz
  • 7,551
  • 4
  • 41
  • 81