![]() |
Transparente Fenster?
Nabend!
Ich such wegen des Song Tickers für Winamp ne Möglichkeit Fenster transparent darzustellen. Wenn ich bei Delphi nach Alphablend suche ( so heissts ja inner VCL ), dann schreiben die da imma was von Bitmaps. Suche n Ansatz wie das zu machen ist. Dangö schon ma :spin: |
Re: Transparente Fenster?
willst du ein anders Programm Transparent machen so wie es das Transparent beim TForm gibt?
|
Re: Transparente Fenster?
Ne mein Eigenes :mrgreen:
Ich such halt sowas wie Alphablend bei der TForm :) |
Re: Transparente Fenster?
:gruebel:
Delphi-Quellcode:
oder so ähnlich.
Form.AlphaBlend := true;
Form.AlphablendValue := 100; //0 - 255 |
Re: Transparente Fenster?
du suchst sowas wie transparent von TForm?
schau mal hier ![]() unter Delphi2005 solltest du das definieren der Konstanten jedoch rausnehmen können (war für D5) |
Re: Transparente Fenster?
Zitat:
Zitat:
// EDIT: Zitat:
Auch wenn ich nich durchsteige :drunken: |
Re: Transparente Fenster?
naja, dann halt mal ne Erklärung. Wie bereits geschrieben war das ganze für Delphi5
Zur Zusammenfassung erstmal der Komplette Source.
Delphi-Quellcode:
Da es unter Delphi5 die Funktion "SetLayeredWindowAttributes" noch nicht gab musste diese hier mittels LoadLibrary und GetProcAddress erst eingebunden werden. Die Konstanten LWA_ALPHA und WS_EX_LAYERED gab es auch noch nicht. Wenn man all das Berücksichtigt sieht die Funktion für D2005 so aus:
function SetFormTransparent(AFormHandle: HWnd; ATransparentVal: Byte): Boolean;
const WS_EX_LAYERED = $00080000; LWA_ALPHA = $00000002; var LStyle: Integer; LDLLHandle: Cardinal; LSetLayerdProc: function (Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; stdcall; begin LDLLHandle := LoadLibrary('user32.dll'); if LDLLHandle <> 0 then begin @LSetLayerdProc := GetProcAddress(LDLLHandle, 'SetLayeredWindowAttributes'); if Assigned(LSetLayerdProc) then begin LStyle := GetWindowLong(AFormHandle, GWL_EXSTYLE); SetWindowLong(AFormHandle, GWL_EXSTYLE, LStyle or WS_EX_LAYERED); result := LSetLayerdProc(AFormHandle, 0, ATransparentVal, LWA_ALPHA); end else result := False; FreeLibrary(LDLLHandle); end else result := False; end;
Delphi-Quellcode:
function SetFormTransparent(AFormHandle: HWnd; ATransparentVal: Byte): Boolean;
var LStyle: Integer; begin LStyle := GetWindowLong(AFormHandle, GWL_EXSTYLE); SetWindowLong(AFormHandle, GWL_EXSTYLE, LStyle or WS_EX_LAYERED); result := SetLayeredWindowAttributes(AFormHandle, 0, ATransparentVal, LWA_ALPHA); end; |
Re: Transparente Fenster?
Ok, das vereinfacht die Sache dann doch schon "etwas" :zwinker:
Vielen Dank :dp: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:00 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz