TDialogService.MessageDialog的颜色 [英] Colors of the TDialogService.MessageDialog

查看:229
本文介绍了TDialogService.MessageDialog的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能解释一下如何获取TDialogService.MessageDialog窗口的二手颜色吗?





更新:使用以下命令创建的:

  TDialogService.MessageDialog ( Test3:确认,MsgDlgType.mtConfirmation,
[TMsgDlgBtn.mbOK],TMsgDlgBtn.mbOK,0,
过程(常量AResult:TModalResult)

结尾);

我需要底部面板(按钮父级)的颜色和消息的背景色。我需要这种颜色来使自己的对话框看起来像FMX默认对话框。



当前,我有自己的高度可定制对话框,如下所示:





在哪里也可以找到在TDialogService.MessageDialog窗口中使用的图标?

解决方案

感谢David Heffernan和



现在我应该调查系统图标的加载


Can you explain how I can get used colors of the TDialogService.MessageDialog window?

Update: Which created using this command:

  TDialogService.MessageDialog('Test3: Confirmation', MsgDlgType.mtConfirmation,
    [TMsgDlgBtn.mbOK], TMsgDlgBtn.mbOK, 0,
    procedure(const AResult: TModalResult)
    begin
    end);

I need color of the bottom panel (Button parent) and background color of the message. I need this color to make my own dialog looks like FMX default dialog.

Currently I have my own highly customizable dialog which looks like this:

And also where I can get icons which used in TDialogService.MessageDialog window?

解决方案

Thanks to the answer of David Heffernan and Triber:

procedure GetThemeBackgroud(AImage: TImage; ATheme: HTHEME; APartID: Integer);
var
  stream: TMemoryStream;
  bitmap: Vcl.Graphics.TBitmap;
begin
  bitmap := Vcl.Graphics.TBitmap.Create;
  try
    bitmap.Width := Round(AImage.Width);
    bitmap.Height := Round(AImage.Height);
    DrawThemeBackground(ATheme, bitmap.Canvas.Handle, APartID, 0,
                        Rect(0, 0, bitmap.Width, bitmap.Height), nil);
    stream := TMemoryStream.Create;
    try
      bitmap.SaveToStream(stream);
      AImage.Bitmap.LoadFromStream(stream);
    finally
      stream.Free;
    end;
  finally
    bitmap.Free;
  end;
end;

procedure GetThemeBackgroud;
var
  theme: HTHEME;
begin
  theme := OpenThemeData(0, 'TASKDIALOG');
  if theme <> 0 then
  try
    // Client color
    GetThemeBackgroud(imgClient, theme, TDLG_PRIMARYPANEL);
    // Bottom color
    GetThemeBackgroud(imgBottom, theme, TDLG_SECONDARYPANEL);
  finally
    CloseThemeData(theme);
  end;
end;

Here we should to add 2 TImages: client and buttons parents:

Now I should investigate of the system icons loading

这篇关于TDialogService.MessageDialog的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆