Udostępnij za pośrednictwem


Image.IsOpaque Property

Definition

Gets or sets a Boolean value that, if true hints to the rendering engine that it may safely omit drawing visual elements behind the image.

public:
 property bool IsOpaque { bool get(); void set(bool value); };
public bool IsOpaque { get; set; }
member this.IsOpaque : bool with get, set
Public Property IsOpaque As Boolean

Property Value

The value of the opacity rendering hint.

Remarks

When this property is true, and if the Opacity property is set to its default value of 1.0, and if the source image is not transparent, then the rendering engine on the target platform can safely ignore those portions of visual elements that appear behind this image when drawing the screen. This can improve performance. However, developers should not set this property to true if the alpha channel of the image indicates transparency, if the Opacity property is less than 1.0, or if the source image itself is transparent. Doing any of these when this property is true may result in visual artifacts or other (undefined) behavior. Conversely, developers should ensure that this property is set to false if they suspect or know that any of the previously mentioned conditions may indicate that the image will be transparent or partially transparent.

Setting this property does not change the opacity of the image. Instead, it indicates whether the rendering engine may treat the image as opaque while rendering.

Applies to