I have a Windows Forms app where I created a UserControl that consists of two But开发者_如何学JAVAtons 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
- The png resolution might be a problem.
- VS version you are using
- 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.
精彩评论