如何获得FMX的气动效果delphi
如何使用FMX在OSX/Windows for delphi xe6中获得类似的“aero效果”? 我看到了这个教程,但它是针对VLC的吗 我正在寻找一种类似于aero的效果。更具体地说,效果模糊了背景。类似于在iOS中看到的模糊覆盖 所以我的表单需要是透明的,然后在表单用作背景的地方模糊图像 感谢@RRUZ,这就是我目前所拥有的。编译,但尚未完全运行:如何获得FMX的气动效果delphi,delphi,delphi-xe6,Delphi,Delphi Xe6,如何使用FMX在OSX/Windows for delphi xe6中获得类似的“aero效果”? 我看到了这个教程,但它是针对VLC的吗 我正在寻找一种类似于aero的效果。更具体地说,效果模糊了背景。类似于在iOS中看到的模糊覆盖 所以我的表单需要是透明的,然后在表单用作背景的地方模糊图像 感谢@RRUZ,这就是我目前所拥有的。编译,但尚未完全运行: unit test; interface uses System.SysUtils, System.Types, System.UIT
unit test;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls
{$IFDEF MACOS32}
,FMX.Platform.Mac,
Macapi.CoreFoundation,
Macapi.CoreGraphics,
Macapi.AppKit,
Macapi.CocoaTypes
{$ENDIF}
;
{$IFDEF MACOS32}
type
CGSConnection = Pointer;
function CGSSetWindowBackgroundBlurRadius(connection: CGSConnection; windowNumber : NSInteger; radius : integer): CGError; cdecl; external libCoreGraphics name _PU + 'CGSSetWindowBackgroundBlurRadius';
function CGSDefaultConnectionForThread : CGSConnection ; cdecl; external libCoreGraphics name _PU + 'CGSDefaultConnectionForThread';
{$ENDIF}
type
TForm1 = class(TForm)
procedure FormShow(Sender: TObject);
private
{ Private declarations }
procedure enableBlurForWindow(Handle : TWindowHandle);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
{ TForm1 }
procedure TForm1.enableBlurForWindow(Handle: TWindowHandle);
var
connection : CGSConnection;
LNSWindow : NSWindow;
begin
LNSWindow:= WindowHandleToPlatform(Handle).Wnd;
LNSWindow.setOpaque(False);
LNSWindow.setBackgroundColor(TNSColor.Wrap(TNSColor.OCClass.colorWithCalibratedWhite(1.0, 0.5)));
connection := CGSDefaultConnectionForThread();
CGSSetWindowBackgroundBlurRadius(connection, LNSWindow.windowNumber, 20);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
enableBlurForWindow(Form1.Handle);
end;
end.
在FMX应用程序中获得此效果比在VCL中简单得多,FMX带来了特定的组件以将效果应用到其他组件或形式(包括模糊效果) 只需将组件放到表单上并激活它
该代码适用于控制台应用程序,它与两个框架都没有关联。当然,玻璃是特定于Windows(Vista和7)的。你怎么能期望在OSX上安装glass?这篇文章描述了在控制台应用程序中使用这些功能(顺便说一句,仅在Windows中可用)。你能详细说明你的问题吗?也许您想应用透明度效果?已编辑。。现在问题更清楚了吗?你希望哪种操作系统能产生这种效果?对于Windows,你可以使用DWM函数,对于OSX,试试这个