简体   繁体   English

在 Visual Studio 中,如何解决 Button 图像质量?

[英]In Visual Studio, how to solve Button image Quality?

I am using Visual Studio 2019 to build an Excel Addin with a Custom Task Pane.我正在使用 Visual Studio 2019 构建带有自定义任务窗格的 Excel 插件。

  • In the User Control used as Custom Task Pane, i added imlNavigation (ImageList)在用作自定义任务窗格的用户控件中,我添加了imlNavigation (ImageList)
  • I tried to generate transparent Images PNG with size [512,512] and attached it with the Buttons, but the Quality is very poor我尝试生成大小为 [512,512] 的透明图像 PNG 并将其附加到按钮上,但质量很差
  • I tried to generate transparent Images PNG [16,16] but no changes.我尝试生成透明图像 PNG [16,16] 但没有任何变化。

Below is the screenshot.下面是截图。 And even the transparency is not good.甚至透明度也不好。 We still see those white colors around the pictures:我们仍然在图片周围看到那些白色:

在此处输入图片说明

Can anyone please suggest me what exactly I shall do as I am still new in Visual Studio?任何人都可以建议我到底该怎么做,因为我还是 Visual Studio 的新手?

  • Where could I get transparent Icons/Images to use for my Buttons?我在哪里可以获得透明图标/图像以用于我的按钮?
  • What Extension shall I use if necessary to get them easily attached with my Buttons?如有必要,我应该使用什么扩展程序来轻松地将它们连接到我的按钮上?
  • Where do I fail and I should still learn regarding the buttons?我在哪里失败,我仍然应该学习有关按钮的知识?

I am willing to learn and to follow you instructions and suggestions.我愿意学习并遵循您的指示和建议。 Thank you in advance!先感谢您!

May be instead of using image list you can use Image Resources ?可能不是使用图像列表,而是可以使用图像资源

  1. Click on the Button点击按钮
  2. On your property click on the assist button of image在您的财产上单击image的辅助按钮
  3. From the Select Resource Dialog box, click on Project Resource File从“选择资源”对话框中,单击“ Project Resource File
  4. Import you pictures (Png transparent) better 25-25px or 20-20px based on the size of your button.根据按钮的大小,将图片(Png 透明)更好地导入 25-25 像素或 20-20 像素。 It accepts transparent images as well它也接受透明图像

This should improve the quality of your button images.这应该会提高按钮图像的质量。

enter image description here在此处输入图片说明

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

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