Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TElToolbar transparency is missing in runtime

Hi,
Please take a look at the pictures attached. Everything is OK in designtime. But the glyphs transparency disappears in runtime.
I use Images and AlphaForImages with the same images in both image lists. In my case the image and alpha mask are the same.
And I'm getting just what I expected to see, but only in design time. The unit is attached.

Is it a bug or my mistake? I tried to change some toolbar properties but wit no luck.

Thank you.

P.S.
Followup - all that occurs when is compiled for x64 ;) Dig your
AlphaCopyRect() or whatever else... Maybe it's a memory alignment
problem. I have no information at this moment about how GetDIBits(),
etc. works in x64.
zip
zip
unit.zip
5K
-designtime.jpg
70 x 347 - 17K
-runtime.jpg
67 x 337 - 20K

Comments

  • 4 Comments sorted by Votes Date Added
  • Is resolved!

    Here is the fix:
    LMDGraphicUtils.AlphaCopyRect2() :

      //<abb2014>
      h_bm := TmpBitmap.Handle;
      h_dc := TmpBitmap.Canvas.Handle;
      SetDIBits(h_dc, h_bm, 0, TmpBitmap.Height, pBits, Info, DIB_RGB_COLORS);
      //</abb2014>

    The problem was in the calls sequence. For some reason TmpBitmap.Canvas.Handle doesn't provide a valid handle unless you'll call TmpBitmap.Handle. At least the opposite lines order never works. And "stdcall" directive calls them just in improper order. At least this is my explanation.

    Also M$ recommends to use VirtualAlloc()/VirtualFree() when you deal with Get/Set DIBIits(). I can send the modified file to you.

    Now dig your sources and find all other similar points :))

    Good luck!

  • Thanks for feedback.

    >>Also M$ recommends to use VirtualAlloc()/VirtualFree() when you deal with Get/Set DIBIits(). I can send the modified file to you.<<
    Yes, please send to mail@lmdsupport.com
  • I already have sent it to your address (rafael@.....), not to LMD. please check your emailbox.
Sign In or Register to comment.