Transparent Form Background not Crisp

cylas_55

New member
Joined
Jul 28, 2009
Messages
3
Programming Experience
5-10
Hello,
I have an app that uses transparency so that the background of the app is a custom shape. The problem I am having is the rounded corners are jagged. Not a nice clean rounded corner like you would see on an icon or widget. I have tried several different image types (i.e. PNG, GIF, etc). But it seems when I use the transparency Key the quality on the edges gets worse. Any help would be greatly appreciated.

VB.NET - VS 2008
 
Hello,
I have an app that uses transparency so that the background of the app is a custom shape. The problem I am having is the rounded corners are jagged. Not a nice clean rounded corner like you would see on an icon or widget. I have tried several different image types (i.e. PNG, GIF, etc). But it seems when I use the transparency Key the quality on the edges gets worse. Any help would be greatly appreciated.

VB.NET - VS 2008

Have you tried changing the Background color of the form to very bright green (google green screen)? :cool:
 
I have not. I will give that a try. Are brighter colors better for transparency? Thanks for the reply :)

in theory ha, but we are working with VS, if that doesn't work then you might want to try "fading" the edge of your form with photoshop, this is what I eventually did, I created a new template with green screen background and drew out my form and faded out the border this seems to work well. I thought more people would post on this so you'd have a few more ideas haha :mad:

let me know what you end up doing im always looking for fun things to do with transparent key.
 
Thanks gain for the ideas. I am now working on fading the edges as you suggested. I had posted a similar thread in another forum and got this response...

"What you're referring to (smooth edges) is called anti-aliasing. It's an advanced graphics technique, and implementing it is not simple. The idea is to make something look smooth by gradually changing the pixels from the color you want to the colors of the surrounding pixles. This is what makes icons and many fonts crisp. Good luck!"
Transparent Form Background not Crisp

So I have been playing around with this is idea as well. Not to much luck though. Here is the code I have been playing around with...
'Get the source Image.
Dim originalImage As New Bitmap(pbxDisplay.Image)

'Make the destination Image.
Dim wid As Integer = pbxDisplay.Image.Width
Dim hgt As Integer = pbxDisplay.Image.Height
Dim newImage As New Bitmap(wid, hgt)

'Copy the image.
Dim gr As Graphics = Graphics.FromImage(newImage)
gr.InterpolationMode = Drawing2D.SmoothingMode.AntiAlias
gr.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBilinear
gr.DrawImage(originalImage, 0, 0, wid - 1, hgt - 1)
gr.DrawImage(originalImage, 0, 0, wid, hgt)

'Display the result.
pbxDisplay.Image = newImage
 
Back
Top