Brush Classe
Définition
public ref class Brush abstract : System::Windows::Media::Animation::Animatable, IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.BrushConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None, Readability=System.Windows.Readability.Unreadable)]
public abstract class Brush : System.Windows.Media.Animation.Animatable, IFormattable
type Brush = class
inherit Animatable
interface IFormattable
interface DUCE.IResource
Public MustInherit Class Brush
Inherits Animatable
Implements IFormattable
- Héritage
- Dérivé
- Attributs
- Implémente
Remarques
Un Brush «peint» ou «remplit» une zone avec sa sortie.A Brush "paints" or "fills" an area with its output. Les différents pinceaux ont différents types de sortie.Different brushes have different types of output. Certains pinceaux peignent une zone avec une couleur unie, d’autres avec un dégradé, un motif, une image ou un dessin.Some brushes paint an area with a solid color, others with a gradient, pattern, image, or drawing. La liste suivante décrit les différents types de WPFWPF pinceaux:The following list describes the different types of WPFWPF brushes:
SolidColorBrush: Peint une zone avec un solide Color.SolidColorBrush: Paints an area with a solid Color.
LinearGradientBrush: Peint une zone avec un dégradé linéaire.LinearGradientBrush: Paints an area with a linear gradient.
RadialGradientBrush: Peint une zone avec un dégradé radial.RadialGradientBrush: Paints an area with a radial gradient.
ImageBrush: Peint une zone avec une image (représentée par un ImageSource objet).ImageBrush: Paints an area with an image (represented by an ImageSource object).
DrawingBrush: Peint une zone avec Drawing.DrawingBrush: Paints an area with a Drawing. Le dessin peut inclure des objets vectoriels et bitmap.The drawing may include vector and bitmap objects.
VisualBrush: Peint une zone avec un Visual objet.VisualBrush: Paints an area with a Visual object. Un VisualBrush vous permet de dupliquer le contenu d’une partie de votre application dans une autre zone. il est très utile pour créer des effets de reflet et des parties de l’écran.A VisualBrush enables you to duplicate content from one portion of your application into another area; it's very useful for creating reflection effects and magnifying portions of the screen.
Pinceaux prédéfinisPredefined Brushes
Utilisez la Brushes classe pour peindre un objet à l’aide d’une couleur unie prédéfinie AliceBlue , Redtelle que ou.Use the Brushes class to paint an object using a predefined solid color, such as AliceBlue or Red.
Pinceaux en XAMLBrushes in XAML
Le tableau suivant répertorie les Brush différents types qui peuvent être utilisés XAMLXAML dans et la syntaxe qu’ils prennent en charge.The following table lists the different Brush types that can be used in XAMLXAML and the syntax they support. Pour obtenir des informations détaillées sur la syntaxe d’un pinceau spécifique, consultez la page de type de ce pinceau.For detailed syntax information for a specific brush, see that brush's type page.
ClasseClass | Syntaxe d’attributAttribute Syntax | Syntaxe de l’élément objetObject Element Syntax |
---|---|---|
SolidColorBrush | OuiYes | OuiYes |
DrawingBrush | NonNo | OuiYes |
ImageBrush | NonNo | OuiYes |
LinearGradientBrush | NonNo | OuiYes |
RadialGradientBrush | NonNo | OuiYes |
VisualBrush | NonNo | OuiYes |
Pour obtenir un exemple illustrant comment peindre rapidement une zone avec une couleur unie, consultez Procédure: Peindre une zone avec une couleurunie.For an example showing how to quickly paint an area with a solid color, see How to: Paint an Area with a Solid Color.
Fonctionnalités FreezableFreezable Features
Un pinceau est un type d' Freezable objet.A brush is a type of Freezable object. Pour plus d' Freezable informations sur les fonctionnalités, telles que le gel et le clonage, consultez la vue d’ensemble des objets Freezable.For information about Freezable features, such as freezing and cloning, see the Freezable Objects Overview.
Utilisation de texte XAMLXAML Text Usage
Pour XAMLXAML plus d’informations, consultez la section Notes .For XAMLXAML information, see the Remarks section.
Notes pour les responsables de l’implémentation
Lorsque vous héritez de Brush la classe, vous devez substituer CreateInstanceCore() la méthode.When you inherit from the Brush class, you must override the CreateInstanceCore() method. Selon que votre classe doit effectuer un travail d’initialisation supplémentaire ou contient des membres de données de propriété de non dépendance, vous devrez peut-être Freezable substituer des méthodes supplémentaires.Depending on whether your class must perform additional initialization work or contains non-dependency property data members, you might need to override additional Freezable methods. Pour plus d’informations sur l’héritage Freezable des types, consultez vue d’ensemble des objets Freezable.For more information about inheriting from Freezable types, see the Freezable Objects Overview.
Constructeurs
Brush() |
Initialise une nouvelle instance de la classe Brush.Initializes a new instance of the Brush class. |
Champs
OpacityProperty |
Identifie la propriété de dépendance Opacity.Identifies the Opacity dependency property. |
RelativeTransformProperty |
Identifie la propriété de dépendance RelativeTransform.Identifies the RelativeTransform dependency property. |
TransformProperty |
Identifie la propriété de dépendance Transform.Identifies the Transform dependency property. |
Propriétés
CanFreeze |
Obtient une valeur qui indique si l’objet peut être rendu non modifiable.Gets a value that indicates whether the object can be made unmodifiable. (Hérité de Freezable) |
DependencyObjectType |
Obtient le DependencyObjectType qui encapsule le type CLRCLR de cette instance.Gets the DependencyObjectType that wraps the CLRCLR type of this instance. (Hérité de DependencyObject) |
Dispatcher |
Obtient le Dispatcher associé à DispatcherObject.Gets the Dispatcher this DispatcherObject is associated with. (Hérité de DispatcherObject) |
HasAnimatedProperties |
Obtient une valeur qui indique si un ou plusieurs objets AnimationClock sont associés à l'une ou l'autre des propriétés de dépendance de cet objet.Gets a value that indicates whether one or more AnimationClock objects is associated with any of this object's dependency properties. (Hérité de Animatable) |
IsFrozen |
Obtient une valeur qui indique si l’objet est actuellement modifiable.Gets a value that indicates whether the object is currently modifiable. (Hérité de Freezable) |
IsSealed |
Récupère une valeur qui indique si cette instance est actuellement sealed (en lecture seule).Gets a value that indicates whether this instance is currently sealed (read-only). (Hérité de DependencyObject) |
Opacity |
Obtient ou définit le degré d’opacité d’un Brush.Gets or sets the degree of opacity of a Brush. |
RelativeTransform |
Obtient ou définit la transformation appliquée au pinceau en utilisant des coordonnées relatives.Gets or sets the transformation that is applied to the brush using relative coordinates. |
Transform |
Obtient ou définit la transformation appliquée au pinceau.Gets or sets the transformation that is applied to the brush. Cette transformation est appliquée après que la sortie du pinceau a été mappée et positionnée.This transformation is applied after the brush's output has been mapped and positioned. |
Méthodes
ApplyAnimationClock(DependencyProperty, AnimationClock) |
Applique AnimationClock au DependencyProperty spécifié.Applies an AnimationClock to the specified DependencyProperty. Si la propriété est déjà animée, le comportement de transfert SnapshotAndReplace est utilisé.If the property is already animated, the SnapshotAndReplace handoff behavior is used. (Hérité de Animatable) |
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) |
Applique AnimationClock au DependencyProperty spécifié.Applies an AnimationClock to the specified DependencyProperty. Si la propriété spécifiée est déjà animée, le comportement HandoffBehavior spécifié est utilisé.If the property is already animated, the specified HandoffBehavior is used. (Hérité de Animatable) |
BeginAnimation(DependencyProperty, AnimationTimeline) |
Applique une animation au DependencyProperty spécifié.Applies an animation to the specified DependencyProperty. L’animation est démarrée lors de la restitution de l’image suivante.The animation is started when the next frame is rendered. Si la propriété spécifiée est déjà animée, le comportement de transfert SnapshotAndReplace est utilisé.If the specified property is already animated, the SnapshotAndReplace handoff behavior is used. (Hérité de Animatable) |
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) |
Applique une animation au DependencyProperty spécifié.Applies an animation to the specified DependencyProperty. L’animation est démarrée lors de la restitution de l’image suivante.The animation is started when the next frame is rendered. Si la propriété spécifiée est déjà animée, le comportement HandoffBehavior spécifié est utilisé.If the specified property is already animated, the specified HandoffBehavior is used. (Hérité de Animatable) |
CheckAccess() |
Détermine si le thread appelant a accès à ce DispatcherObject.Determines whether the calling thread has access to this DispatcherObject. (Hérité de DispatcherObject) |
ClearValue(DependencyProperty) |
Efface la valeur locale d’une propriété.Clears the local value of a property. La propriété à effacer est spécifiée par un identificateur DependencyProperty.The property to be cleared is specified by a DependencyProperty identifier. (Hérité de DependencyObject) |
ClearValue(DependencyPropertyKey) |
Efface la valeur locale d’une propriété en lecture seule.Clears the local value of a read-only property. La propriété à effacer est spécifiée par DependencyPropertyKey.The property to be cleared is specified by a DependencyPropertyKey. (Hérité de DependencyObject) |
Clone() |
Crée un clone modifiable de ce Brush, en créant des copies intégrales des valeurs de l’objet.Creates a modifiable clone of this Brush, making deep copies of this object's values. Pendant la copie des propriétés de dépendance, cette méthode copie les références de ressources et les liaisons de données (qui risquent toutefois de ne plus pouvoir se résoudre), mais pas les animations ni leurs valeurs actuelles.When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values. |
CloneCore(Freezable) |
Fait de l’instance un clone (copie complète) du Freezable spécifié utilisant des valeurs de propriété (non animée) de base.Makes the instance a clone (deep copy) of the specified Freezable using base (non-animated) property values. (Hérité de Freezable) |
CloneCurrentValue() |
Crée un clone modifiable de cet objet Brush, en effectuant une copie complète des valeurs actuelles de cet objet.Creates a modifiable clone of this Brush object, making deep copies of this object's current values. Contrairement à leurs valeurs actuelles, les références de ressources, les liaisons de données et les animations ne sont pas copiées.Resource references, data bindings, and animations are not copied, but their current values are. |
CloneCurrentValueCore(Freezable) |
Fait de l’instance un clone (copie complète) modifiable du Freezable spécifié à l’aide des valeurs de propriété actuelles.Makes the instance a modifiable clone (deep copy) of the specified Freezable using current property values. (Hérité de Freezable) |
CoerceValue(DependencyProperty) |
Convertit la valeur de la propriété de dépendance spécifiée.Coerces the value of the specified dependency property. Pour cela, on appelle toute fonction CoerceValueCallback spécifiée dans les métadonnées de propriété pour la propriété de dépendance telle qu’elle existe sur le DependencyObject appelant.This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Hérité de DependencyObject) |
CreateInstance() |
Initialise une nouvelle instance de la classe Freezable.Initializes a new instance of the Freezable class. (Hérité de Freezable) |
CreateInstanceCore() |
Une fois implémentée dans une classe dérivée, initialise une nouvelle instance de la classe dérivée Freezable.When implemented in a derived class, creates a new instance of the Freezable derived class. (Hérité de Freezable) |
Equals(Object) |
Détermine si un DependencyObject fourni est équivalent au DependencyObject réel.Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (Hérité de DependencyObject) |
Freeze() |
Rend l’objet actif non modifiable et attribue à sa propriété IsFrozen la valeur |
FreezeCore(Boolean) |
Rend cet objet Animatable non modifiable ou détermine s'il peut être rendu non modifiable.Makes this Animatable object unmodifiable or determines whether it can be made unmodifiable. (Hérité de Animatable) |
GetAnimationBaseValue(DependencyProperty) |
Retourne la valeur non animée de la propriété DependencyProperty spécifiée.Returns the non-animated value of the specified DependencyProperty. (Hérité de Animatable) |
GetAsFrozen() |
Crée une copie figée de Freezable, à l'aide des valeurs de propriété (non-animées) de base.Creates a frozen copy of the Freezable, using base (non-animated) property values. Étant donné que la copie est figée, tous les sous-objets figés sont copiés par référence.Because the copy is frozen, any frozen sub-objects are copied by reference. (Hérité de Freezable) |
GetAsFrozenCore(Freezable) |
Transforme l’instance en clone figé du Freezable spécifié utilisant des valeurs de propriété (non animée) de base.Makes the instance a frozen clone of the specified Freezable using base (non-animated) property values. (Hérité de Freezable) |
GetCurrentValueAsFrozen() |
Crée une copie figée de Freezable à l'aide des valeurs de propriété actuelles.Creates a frozen copy of the Freezable using current property values. Étant donné que la copie est figée, tous les sous-objets figés sont copiés par référence.Because the copy is frozen, any frozen sub-objects are copied by reference. (Hérité de Freezable) |
GetCurrentValueAsFrozenCore(Freezable) |
Convertit l'instance actuelle en un clone figé du Freezable spécifié.Makes the current instance a frozen clone of the specified Freezable. Si l’objet a des propriétés de dépendance animées, leurs valeurs animées actuelles sont copiées.If the object has animated dependency properties, their current animated values are copied. (Hérité de Freezable) |
GetHashCode() |
Obtient un code de hachage pour ce DependencyObject.Gets a hash code for this DependencyObject. (Hérité de DependencyObject) |
GetLocalValueEnumerator() |
Crée un énumérateur spécialisé pour déterminer quelles propriétés de dépendance ont des valeurs définies localement sur ce DependencyObject.Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Hérité de DependencyObject) |
GetType() |
Obtient le Type de l'instance actuelle.Gets the Type of the current instance. (Hérité de Object) |
GetValue(DependencyProperty) |
Retourne la valeur effective actuelle d’une propriété de dépendance sur cette instance d’un DependencyObject.Returns the current effective value of a dependency property on this instance of a DependencyObject. (Hérité de DependencyObject) |
InvalidateProperty(DependencyProperty) |
Réévalue la valeur effective de la propriété de dépendance spécifiée.Re-evaluates the effective value for the specified dependency property. (Hérité de DependencyObject) |
MemberwiseClone() |
Crée une copie superficielle du Object actuel.Creates a shallow copy of the current Object. (Hérité de Object) |
OnChanged() |
Appelé lorsque l’objet Freezable actuel est modifié.Called when the current Freezable object is modified. (Hérité de Freezable) |
OnFreezablePropertyChanged(DependencyObject, DependencyObject) |
Garantit que les pointeurs de contexte appropriés sont établis pour un membre de données de type DependencyObjectType qui vient juste d'être défini.Ensures that appropriate context pointers are established for a DependencyObjectType data member that has just been set. (Hérité de Freezable) |
OnFreezablePropertyChanged(DependencyObject, DependencyObject, DependencyProperty) |
Ce membre prend en charge l’infrastructure Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) et n’est pas destiné à être directement utilisé à partir de votre code.This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. (Hérité de Freezable) |
OnPropertyChanged(DependencyPropertyChangedEventArgs) |
Substitue l’implémentation DependencyObject de OnPropertyChanged(DependencyPropertyChangedEventArgs) pour appeler également tous les gestionnaires Changed en réponse à une propriété de dépendance variable de type Freezable.Overrides the DependencyObject implementation of OnPropertyChanged(DependencyPropertyChangedEventArgs) to also invoke any Changed handlers in response to a changing dependency property of type Freezable. (Hérité de Freezable) |
ReadLocalValue(DependencyProperty) |
Retourne la valeur locale d’une propriété de dépendance, si elle existe.Returns the local value of a dependency property, if it exists. (Hérité de DependencyObject) |
ReadPreamble() |
Garantit que Freezable est accessible à partir d'un thread valide.Ensures that the Freezable is being accessed from a valid thread. Les héritiers de Freezable doivent appeler cette méthode au début de toute API lisant les membres de données qui ne sont pas des propriétés de dépendance.Inheritors of Freezable must call this method at the beginning of any API that reads data members that are not dependency properties. (Hérité de Freezable) |
SetCurrentValue(DependencyProperty, Object) |
Définit la valeur d’une propriété de dépendance sans modifier sa valeur source.Sets the value of a dependency property without changing its value source. (Hérité de DependencyObject) |
SetValue(DependencyProperty, Object) |
Définit la valeur locale d’une propriété de dépendance, spécifiée par son identificateur de propriété de dépendance.Sets the local value of a dependency property, specified by its dependency property identifier. (Hérité de DependencyObject) |
SetValue(DependencyPropertyKey, Object) |
Définit la valeur locale d’une propriété de dépendance en lecture seule, spécifiée par l’identificateur DependencyPropertyKey de la propriété de dépendance.Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Hérité de DependencyObject) |
ShouldSerializeProperty(DependencyProperty) |
Retourne une valeur qui indique si les processus de sérialisation doivent sérialiser la valeur de la propriété de dépendance fournie.Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Hérité de DependencyObject) |
ToString() |
Retourne une représentation sous forme de chaîne de ce Brush.Return string representation of this Brush. |
ToString(IFormatProvider) |
Crée une représentation sous forme de chaîne de cet objet selon les informations de mise en forme spécifique à la culture spécifiées.Creates a string representation of this object based on the specified culture-specific formatting information. |
VerifyAccess() |
Garantit que le thread appelant a accès à DispatcherObject.Enforces that the calling thread has access to this DispatcherObject. (Hérité de DispatcherObject) |
WritePostscript() |
Déclenche l’événement Changed pour le Freezable et appelle sa méthode OnChanged().Raises the Changed event for the Freezable and invokes its OnChanged() method. Les classes qui dérivent de Freezable doivent appeler cette méthode à la fin de toute API qui modifie des membres de classe qui ne sont pas stockés en tant que propriétés de dépendance.Classes that derive from Freezable should call this method at the end of any API that modifies class members that are not stored as dependency properties. (Hérité de Freezable) |
WritePreamble() |
Vérifie que le Freezable n'est pas figé et que son accès s'effectue à partir d'un contexte de thread valide.Verifies that the Freezable is not frozen and that it is being accessed from a valid threading context. Les héritiers de Freezable doivent appeler cette méthode au début de toute API écrivant dans les membres de données qui ne sont pas des propriétés de dépendance.Freezable inheritors should call this method at the beginning of any API that writes to data members that are not dependency properties. (Hérité de Freezable) |
Événements
Changed |
Se produit lorsque Freezable ou un objet qu'il contient est modifié.Occurs when the Freezable or an object it contains is modified. (Hérité de Freezable) |
Implémentations d’interfaces explicites
IFormattable.ToString(String, IFormatProvider) |
Met en forme la valeur de l'instance actuelle à l'aide du format spécifié.Formats the value of the current instance using the specified format. |