简体   繁体   中英

poor image quality in windows forms app (no AA)

I have a Windows Forms app where I created a UserControl that consists of two Buttons and one Label. The Buttons have an png with transparent Background assigned.

If I look at the UserControl in the Windows Forms Designer it looks great. However, if I drop the UserControl onto a form it doesn't have it's smooth edges anymore.

Here are some screenshot to show what I mean:

替代文字替代文字

Does anyone know how to fix this?

I tried the thing you have said.. I have few suggestions

  1. The png resolution might be a problem.
  2. VS version you are using
  3. Also check whether you have docked the buttons in the usercontrol therefore when you resize it in your form the image quality might go down... (Not so sure)

Anyway you can try with another image. Because when I tried this with my PNGs no problems occured.

From the looks of it, you are rescaling your PNG for few pixels down or up. Try to see what will happen if you ensure that size on the screen is the size of the image itself.

So, try to increase or decrease button sizes one pixel at a time and see what happens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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