I have windows form PictureBox Control1 that displays video. I would like to create a transparent overlay Control2 that displays text over the video window.
I tried creating Control2 with BackgroundColor and TransparencyKey set to the same color, ex Color. Green, and adding it to Control1, but the second window just obscures the first one.
Spent the day looking for code that works, but no luck so far.
Related
I have a WPF window and an Image in a grid in the window. I am animating the Image so it moves from out of view (beyond widow location) into the window.
The animation is nice and smooth and everything works but I notice the image is over top of the window border while it is moving. The image at the end of this question is what it looks like.
Why would the image be over top of the window border, and how do I get it to be "under" the border?
Thanks in advance!
Well after a lot of trial and error it seems the problem was the fact I was moving the image in a grid that had no defined width, so the width would expand over the border when moving the image thus extending the "client" area of the window and showing over the window area.
Once I defined a specific width of the grid, everything worked.
im developing a custom form and i want that the non-client area be transparent. im handling the non client area painting via message number "0x85" and this is what i have tried so far:
Paint using the color "Color.Transparent" -> the non-client area was painted black. If I had used an image of red or black or green, it works perfectly, but transparent = black
Created a transparent image of the size of the form and used the method "myGraphics.DrawImage("img.png")". the background remained black. If I had used an image of red or black or green, it works perfectly also...
Not paint anything (hoping that i just would stay transparent)... not worked
Getting parts of a window transparent requires hardware support, a video adapter feature called layering. Use the form's TransparencyKey property. Set it to an unusual color, like Color.Fuchsia. And draw with that color to get the video adapter to omit the pixels.
I have to create a program that starts with a splash screen and a transparent image, but in windows form not working there always the white background, how can I do?
You need to set a transparency key. If you set it to white, it will make everything that's white on the form transparent (doesn't work well with the picturebox control though).
So for instance, you create a panel, and give it the background image you want to be displayed, then set the transparency key to whatever color should be made transparent ;p
can anyone help me how to apply transparency on picturebox on Winforms? I have a panel as a main container having a background picture, and I have a picturebox which overlapped on it. So all I need is to have a transparency on picturebox.
Set the Backcolor property of the PictureBox to Transparent.
Ofcourse, make sure that the image you're using is transparent as well (i.e. no background color).
Go to the properties of the PictureBox and set the Back Color to "Transparent".
With code you can do it like:
pictureBox1.BackColor = Color.Transparent;
Our app has a WPF FlowDocumentScrollViewer that shows a flowdocument with text in three font colors: Lavender, #FFFFFFE8, and Orange. The background of the Viewer is set to transparent, with the window behind it having a Black background. This works fine for everybody except for one customer. For him, the Lavender colored text shows up as white, and the text that should be the other two colors shows up as black. Black text is hard to read against a black background.
I imagine there is some windows setting that is causing the font colors to be displayed in black and white on his computer. Can anyone please point me to the correct setting? And is there anyway to override this behavior in the xaml or code behind?