I turned the BackColor of the Form into Green and then the TransparencyKey into the BackColor (that would turn the background color of the WF into Transparent)
this.BackColor = Color.Green;
this.TransparencyKey = BackColor;
But when I run the project the label I got on the upper left-corner has a pixeled outline of color green...
I tried turning the label's BackColor into Green hoping that it will turn the pixels transparent... but that didn't happened.
Also I got an image with transparent background (.png with transparent background) and that image got the pixels too. Also tried chaning the BackColor from green to lime but that did nothing but worsening the situation (more pixels than before)...
Anyone out there know how to remove those green pixels?
Related
I have a Form on which TransparencyKey = Color.Black is applied.
Form contains a TextBox and it's text ForeColor is Red.
When Form transparency is active, i.e. when TransparencyKey = Color.Black text looks somehow distorted it looks like some black background elements were not removed with TransparencyKey, when form is placed on any bright (white) background.
When form is presented on dark background, everything looks ok.
I have posted a screen of my form to show you this behaviour (inserting image does not work for me right now I dunno why):
How to fix this so that text will be smooth as it should be independent on the background colour?
I want to use Graphics.FillRectangle with a HatchBrush, drawing on a transparent window with a ControlStyles.SupportsTransparentBackColor style.
Therefore I must disable the line smoothing that appears when the (diagonal) lines are drawn by the hatch brush, otherwise I get a combined color of the brush's color and Magenta, which is the transparency key color, resulting in a somehow Magenta hatch, regardless of my chosen color.
I have tried various mode properties of my Graphics object, without luck.
I have an ellipse with a stroke, so:
myEllipse.Stroke = Brushes.Yellow;
I need it to be yellow, but it doesn't always show up nicely on white backgrounds, which is pretty common in this scenario.
I was wondering if there was a way to put the Yellow Stroke on a black background.
myEllipse.Stroke = Brushes.Black;
myEllipse.Stroke = Brushes.Yellow;
Where instead of the yellow replacing the black, it would be a combination so that it always appears yellow as if the background image was black.
You could draw two ellipses on top of each other. The first would be black and slightly thicker than the second which would be yellow.
They get drawn in the order they are added to their container object (view, grid or whatever), so make sure you add them in the order "black" then "yellow".
I am trying to make a transparent form that will be shown on the bottom right corner of the screen. In that form, I have an image as a background that I am rotating. The issue is, when I use the following code to make the form transparent, I am getting outlines on the image that is equivalent to the color I set for the transparency key/background. Is this because of the image, or is there a way to fix this programmatically?
CODE:
this.TransparencyKey = Color.Orange;
this.BackColor = Color.Orange;
This gives me an orange outline around my image.
You can't make the border transparent but you can get rid of it altogether.
To get rid of the border you would use this.
FormBorderStyle = FormBorderStyle.None;
When I move a picturebox in a form when application is started, I want picturebox backcolor with transparency using back object color, But no transparent with form backcolor
If you are looking to set the back color as same as the form which is solid color. U can user the Backcolor property of the picture box and set it to form's back color.
Also have a look at this post.
C# Picturebox transparent background doesn't seem to work