Skip to content

Broken rendering with BackgroundImage and transparent BackColor #13784

@koszeggy

Description

@koszeggy

.NET version

.NET 5.0 - .NET 9.0

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Works in .NET Framework and .NET Core 3.x

Issue description

Set a background image and transparent background for a non-root level container object, such as a GroupBox or a Panel, and add child controls to it. While the background image offset is applied correctly to the child controls, this is not true for the 'foreground' content of the parent, which is reflected in every child control with an incorrect origin.

It apparently affects system rendering only (i.e. when FlatStyle is System), or when a control has no FlatStyle (e.g. a Panel).

Consider the example below:

Designer:
Image

Rendering in .NET Framework:
Image

Rendering in .NET Core/.NET:
Image
(Note the "ghost" group boxes appearing in the panel and other controls. The image itself is rendered correctly in the children even if they are over a more colorful area.)

Steps to reproduce

See the attachment:

BackgroundImageIssue.zip

Metadata

Metadata

Labels

needs-area-labeluntriagedThe team needs to look at this issue in the next triage

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions