problem getting a form image background
- by Deumber
I'm creating a datagridview transparent
//I got the parent background image
Bitmap parentBackGround = new Bitmap(this.Parent.BackgroundImage);
//Set the area i want to create equal to the size of my grid
Rectangle rect = new Rectangle(this.Location.X, this.Location.Y, this.Width, this.Height);
//And draw in the entire grid the area of the background image that is cover with my grid, making a "transparent" effect.
graphics.DrawImage(parentBackGround.Clone(rect, PixelFormat.Format32bppRgb), gridBounds);
When the backgroundimage of the grid's parent is show in an normal layout all work ok, but if the layout is stretch, center or any other, the transparency effent gone, have you any idea to fix it?