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;
Related
I am setting the background color of my Canvas as 'white'. However when I compare my canvas with a vendor application, their canvas is 'whiter', which is the color I want for my canvas too. I have looked at all the color choices available for canvas background color but nothing makes my canvas any whiter than it is. Any suggestions would be appreciated.
Simple solution:
Use one of the browser plugins to get the actual "white" color of their app.
One example of a color-picker is Chrome plus the ColorZilla extension:
https://chrome.google.com/webstore/detail/colorzilla/bhlhnicpbhignbdhedgjhgdocnmhomnp
I create a Silverlight OOB application in which I try to change the background color of the window transparent. I would like to use as wallpaper its own image. This is not square and therefore interferes with the white background color of the main window.
In the OutOfBrowserSettings I can put as the "Window Style" to "none ".
In WPF there are the two following window properties:
AllowsTransparency = "True"
Background = "Transparent"
Unfortunately, this does not seem to know about Silverlight, though! Does anyone know how I get the background color of the main window transparent?
Have you tried to set beackground to {x:Null}? Or maybe to set the alpha in color to 0 which means transparent. For example #00FFFFFF or #00000000.
This is not possible with the current version (4) of Silverlight.
I am using the pictureBox_Paint event to try and draw an overlay onto the image in a PictureBox.
This is working fine until I resize the PictureBox (set to use SizeMode.Zoom), when I do this the overlay graphic is drawn off position by the margin between the image and the edge of the PictureBox. I guess I need to use the ImageRectangle somehow but this is not public.
I would create a custom usercontrol instead, you would have much more control, and would not be difficult to build.
How can I change the color of a DataGridView border when BorderStyle = FixedSingle?
You cannot change the border color, it is system defined.
Instead you could try turning off the border setting and then placing the DataGridView inside a Panel. Where the DataGridView is set to Dock.Fill and the Panel has a Padding of 1 pixel on all edges. Then setting the background color of the Panel will show as a border around the contained DataGridView.
this.dataGridView1.GridColor = Color.BlueViolet;
source: http://msdn.microsoft.com/en-us/library/ehz9ksfa.aspx
You could change the border if you make your own DataGridView and override the OnPaint() method. Be sure to call base.OnPaint(e) before you do your own magic.
Also, you could add a property "GridBorderColor" which set color, your own painting would use.
My problem is:
I have a Canvas which covers part of my Window. The Opacity of the canvas is set to less than 1, i.e. I can view the controls under the Canvas. What I would like to do is place a control, any control, say a Button, on the canvas and not have that Button semitransparent. Is this possible using WPF?
Try the alpha in the color of the canvas.