why black color?
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.
hello,
can anyone tell me why i get always a black backcolor instead of transparent color
even search on google it seems i do everything correct and still gets a black color
thanks
can anyone tell me why i get always a black backcolor instead of transparent color
even search on google it seems i do everything correct and still gets a black color
Code: Select all
Inherits Button
Public Sub New()
Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.UserPaint Or _
ControlStyles.OptimizedDoubleBuffer, True)
BackColor = Color.Transparent
End Sub
Code: Select all
Protected Overrides Sub OnPaint(pevent As PaintEventArgs)
Dim g As Graphics = pevent.Graphics
g.SmoothingMode = SmoothingMode.AntiAlias
g.Clear(Color.Transparent)
g.DrawImage(Frmpl.Px1.Image, 0, 0, 39, 41)
End Sub
thanks
Last edited by Dummy1912 on Mon Feb 17, 2014 1:58 pm, edited 1 time in total.
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Try removing this line
Code: Select all
g.Clear(Color.Transparent)
You can find me on Facebook or on Skype mihai_92b
XTechVB wrote:Try removing this line#XTechVB,Code: Select allg.Clear(Color.Transparent)
tried it, but when run app black color comes back :(
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
the bitmap is empty that is why it's color is black.
try to make a rectangle and fill it with the (new solidbrush(me.backcolor))
try to make a rectangle and fill it with the (new solidbrush(me.backcolor))
What are you trying to do? Draw a PNG image while keeping it's transparent background?
You can find me on Facebook or on Skype mihai_92b
i guess he/she is making a class for a custom control.
i pretty sure, that the bitmap will turn out black , because its empty.
it's just set to the size of the control or something.
i pretty sure, that the bitmap will turn out black , because its empty.
it's just set to the size of the control or something.
#Dummy1912 try this:
Hope I helped, and the code is from MSDN.
Code: Select all
To have a transparent color on the form, it needs to have a TransparencyKey set to the same color that you want transparent. Public Sub InitializeMyForm()
BackColor = Color.Black
' Make the background color of form display transparently.
TransparencyKey = BackColor
End Sub 'InitializeMyForm
Hope I helped, and the code is from MSDN.
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
#smashapps sorry but this can't be used:
'TransparencyKey' is not declared. It may be inaccessible due to its protection level.
#noypikami
last time we checked i'm still a HE :lol:
'TransparencyKey' is not declared. It may be inaccessible due to its protection level.
#noypikami
last time we checked i'm still a HE :lol:
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
'TransparencyKey' is not declared. It may be inaccessible due to its protection level.I believe only "Form" type controls have the "TransparencyKey" property. Won't work on other controls.
You can find me on Facebook or on Skype mihai_92b
Copyright Information
Copyright © Codenstuff.com 2020 - 2023