Bordless Form with a weird border in a image
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts
Page 1 of 1
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.
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.
umm try double buffer true tht might help or try aa new colour I use fushia and have no probs
Cant do anything about it
muttley1968 wrote:umm try double buffer true tht might help or try aa new colour I use fushia and have no probsWhat do you mean double buffer?Can you teach me how to do it?
and changing to fuschia still doesn't work...
I dont think there is an easy way to do it..could be wrong :?
Sometimes it can be the quality of the image itself and its not a good idea to stretch the image over the form.
Download and add this altered image to project resources
Try buffering the form and then drawing the image onto it:
Sometimes it can be the quality of the image itself and its not a good idea to stretch the image over the form.
Download and add this altered image to project resources

Try buffering the form and then drawing the image onto it:
Code: Select all
Makes it a little clearer. Dim Backi As Bitmap = My.Resources.test
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.Graphics.DrawImageUnscaled(New Bitmap(Backi), 0, 0)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SetStyle(ControlStyles.DoubleBuffer, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
Me.SetStyle(ControlStyles.UserPaint, True)
End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
CodenStuff wrote:I dont think there is an easy way to do it..could be wrong :?But the problem is that i don't want to have a background, so that image wont work...
Sometimes it can be the quality of the image itself and its not a good idea to stretch the image over the form.
Download and add this altered image to project resources
![]()
Try buffering the form and then drawing the image onto it:
Code: Select allMakes it a little clearer.Dim Backi As Bitmap = My.Resources.test Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias e.Graphics.DrawImageUnscaled(New Bitmap(Backi), 0, 0) End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.SetStyle(ControlStyles.DoubleBuffer, True) Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True) Me.SetStyle(ControlStyles.UserPaint, True) End Sub
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023