简体   繁体   English

在WPF中设置应用程序图标的大小

[英]Setting size of Application Icon in WPF

I have a code wherein i put an image on my Application icon: 我有一个代码,其中我在“应用程序”图标上放了一个图像:

Title="Test WPF" Height="600" Width="800" WindowStartupLocation="CenterScreen" Closing="WindowClosing" Icon="ICON.PNG"

I know that the icon size is like 12 x 12 or 24 x 24. 我知道图标的大小约为12 x 12或24 x 24。

Is it possible to have the Application Icon customize on size? 是否可以按大小自定义应用程序图标? like 40 x 24? 像40 x 24?

You can use the WindowChrome class to customize the non-client area of a window. 您可以使用WindowChrome类自定义窗口的非客户区域。 In this page there is a section specifically mention the application icon and title. 在此页面中,有一节专门提到应用程序图标和标题。

The application icon and title are not displayed by the WindowChrome class; WindowChrome类不会显示应用程序图标和标题。 they have to be added to the border as custom content. 它们必须作为自定义内容添加到边框。

This is an example on how to do that. 这是有关如何执行此操作的示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM