Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Child Window Transparent (https://www.delphipraxis.net/192483-child-window-transparent.html)

EWeiss 21. Apr 2017 20:04


Child Window Transparent
 
Gibt es eine andere Möglichkeit ein Child Window transparent zu setzen ohne SetWindowRgn?
Ich möchte damit einen Overlay Text auf mein VideoWindow setzen.

Im Moment gehe ich so vor.

Delphi-Quellcode:
    WM_TIMER:
      begin
        if wP = MOVIE_TIMER then
        begin
          if TimerTick then
          begin
            Result := 0;
            exit;
          end;

          if aMediaProperty.PlaybackLength > 0 then
            try
              MilSecond := KVideo_GetStreamPosition div 10000;
              trbSearch.SetTrackValue(trbSearch.Handle, MilSecond);
              Second := MilSecond div 1000;
             
              if Second = LastPlayingPos then
              begin
                TimerTick := false;
                Result := 0;
                exit;
              end
              else
                LastPlayingPos := Second;

              time := FormatDateTime('hh:nn:ss', Second / 86400);

              w := 255;
              h := 60;

              rw.Right := w;
              rw.Bottom := h;
              rw.Left := 0;
              rw.Top := 0;

              DC := GetDC(TextHandle);

              hTempDC := DoubleBuffer(DC, rw.Right, rw.Bottom, CreateBuffer);

              GDIP_DrawTextToDC(hTempDC, time, rw, MakeColor
                (255, 3, 123, 250), 'LCDDisplayCapsSSK', 60, FontStyleBold, -1, 0, LCDFont);

              SKAERO_SetCTLText(lblMovieElapsed.Handle, time);

              ARgn := RegionFromBitmap(FDBufferhBMTemp, $000000);
              SetWindowRgn(TextHandle, ARgn, true);
            finally
              DoubleBuffer(0, 0, 0, DestroyBuffer);
              ReleaseDC(TextHandle, DC);
              DeleteObject(ARgn);
            end;
        end;
      end;
Das funktioniert soweit ganz gut. Mir wäre aber eine einfachere Lösung lieber.

gruss


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz