Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

Child Window Transparent

  Alt 21. Apr 2017, 20:04
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

Geändert von EWeiss (11. Jul 2019 um 15:47 Uhr)
  Mit Zitat antworten Zitat