![]() |
AlphaBlend für Delphi 5 Prof.
Hi,
wie kann ich eine AlphaBlend in Delphi5 benutzen. Wenn ich das dann in eine Kompo setze, welchen Vorfahrtyp könnte ich nehmen ? |
Re: AlphaBlend für Delphi 5 Prof.
|
Re: AlphaBlend für Delphi 5 Prof.
Cool, thx !
Mit
Delphi-Quellcode:
Lass ich die Form verschwinden, nur wie lasse ich sie so erscheinen ?
var i : integer;
begin for i := 100 downto 0 do begin MakeTransparent(Handle,i); Application.ProcessMessages; end; Close; |
Re: AlphaBlend für Delphi 5 Prof.
Delphi-Quellcode:
for i := 0 to 100 do
begin MakeTransparent(Handle,i); Application.ProcessMessages; end; |
Re: AlphaBlend für Delphi 5 Prof.
Nein, ahb ich auch schon probiert.
|
Re: AlphaBlend für Delphi 5 Prof.
aber du musst das Fenster vorher wieder öffnen.... schließlich hast du es ja mit Form1.Close geschlossen
|
Re: AlphaBlend für Delphi 5 Prof.
gut,
und weißt du noch, wie ich alles in eine Unit packe, sodass ich nur noch im Uses-Teil die Unit einbinden muss und dann nur noch
Delphi-Quellcode:
sagen muss ?
MakeTransparent(Handle, 100);
[edit]Ich meine, ich habe ein Projekt und muss es nur noch einbidnen und aufrufen. [/edit] Die bisherige Unit:
Delphi-Quellcode:
unit trans;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; implementation type TSetLayeredWindowAttributes = function ( hwnd : HWND; // handle to the layered window crKey : TColor;// specifies the color key bAlpha : byte;// value for the blend function dwFlags : DWORD// action ): BOOL; stdcall; const WS_EX_LAYERED = $80000; LWA_COLORKEY = 1; LWA_ALPHA = 2; procedure MakeTransparent(AHandle : THandle; AValue : byte = 0); var Info: TOSVersionInfo; SetLayeredWindowAttributes: TSetLayeredWindowAttributes; begin //Check Windows version Info.dwOSVersionInfoSize := SizeOf(Info); GetVersionEx(Info); if (Info.dwPlatformId = VER_PLATFORM_WIN32_NT) and (Info.dwMajorVersion >= 5) then begin SetLayeredWindowAttributes := GetProcAddress(GetModulehandle(user32),'SetLayeredWindowAttributes'); if Assigned(SetLayeredWindowAttributes) then begin SetWindowLong(AHandle, GWL_EXSTYLE, GetWindowLong(AHandle, GWL_EXSTYLE) or WS_EX_LAYERED); //Make form transparent SetLayeredWindowAttributes(AHandle, 0, AValue, LWA_ALPHA); end; end; end; end. |
Re: AlphaBlend für Delphi 5 Prof.
also einfach die Prozedurendeklaration zwischen interface und implementation einfügen
Delphi-Quellcode:
schöner wär's natürlich, wenn du ne eigene FormsKlasse von TForm ableitest... dann könntest du, ähnlich wie ab D6 die Alphablendwerte direkt per Property setzen.
unit TransparencyHelper;
interface procedure MakeTransparent(AHandle: HWND; AValue: byte = 0); implementation procedure MakeTransparent(AHandle: HWND; AValue: byte = 0); begin //und hier dein Code end; |
Re: AlphaBlend für Delphi 5 Prof.
thx, das läuft jetzt, aber das erscheinen läuft immer noch nciht.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:51 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