Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
3.33/5 (3 votes)
See more:
Well, i have a problem and i think you guys maybe can help me.

Every time i try to create a form bordless with a image, the image border will always stay weird, something like a "No Anti-Aliasing" thinging.

http://s10.postimage.org/n3uehx553/Capture.png

To make this i only set the background image to this png image( http://s12.postimage.org/ufpe2nt6j/test.png ), set the BackColor and the TransparencyKey to the color Lime and i set the FormBorderStyle to "None".

Maybe i'm doing something wrong, i don't know, so i hope you guys can help me.

Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 16-Sep-12 13:54pm    
This is really the problem for some non-rectangular forms or windows like that. I don't know really good solution. It looks like anti-aliasing of window edges is not supported by OS, and every approach could just alleviate the problem slightly, not resolve it. I voted 5 for the question, but this is a known problem.
--SA

1 solution

Set the BackColor and the TransparencyKey to this color, and you will see a red border:
R = 254
G = 0
B = 0

Now, you can think: "Why is the R value not 255?".
If you set the R value of the BackColor and the TransparencyKey to 255,
this will hide your background image, because the background color of your image is red. So, you need to set it to 254.

Hope this helps.
 
Share this answer
 
v2
Comments
ceewwb 16-Sep-12 12:30pm    
it looks better, but not perfect because the edges are not smooth and look sharp.If you compare the original image to the form image, you will see that sharp border.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900