PngBitBtn header does not display when runtime themes are enabled

I made a simple project with one PngBitBtn, and then compiled it with the following configuration:

  • Topics
  • disconnected
    • Debug Mode - OK
    • Release Mode - OK
    Topics
  • included
    • Debug Mode - OK
    • Release Mode - PngBitBtn Missing Signature

The only way to display the signature correctly is to disable optimization. Is it possible to solve this problem without disabling optimization?

Thanks Tim

Tested on Delphi XE3, XE6. Platform: win32. PNGComponents Version: The latest version from embarcadero CodeCentral.

print screen:

Print screen

+5
source share
1 answer

Just a mistake!

To fix this, insert the following line on line 326 in the PngBitBtn.pas TPngBitBtnStyleHook.DrawButton method:

Offset := TPoint.Create(0, 0); 

The code in this area should now look like this:

  if not (Control is TPngBitBtn) then begin inherited; Exit; end; Offset := TPoint.Create(0, 0); DrawRect := Control.ClientRect; 
+7
source

Source: https://habr.com/ru/post/1208442/


All Articles