user8210624
user8210624

Reputation:

WPF Label background png image transparent

I am using png image for label background. The blank parts of the label look black. It is should be transparent. How can I do it that?

sample

lbl_popuptext.Background = new ImageBrush(new BitmapImage(new Uri("../../images/icons/appoint_popupbox.png", UriKind.Relative)));

Upvotes: 1

Views: 967

Answers (2)

user8210624
user8210624

Reputation:

I solved. Popup AllowsTransparency property should be true

Upvotes: 1

Leonid Z
Leonid Z

Reputation: 161

I think, it is transparent. Check your image first: sometimes the layer that should be transparent, indeed is not. You can use GIMP2 for example to check it, or just insert the image into the PowerPoint project etc.

Upvotes: 0

Related Questions