Share via


AppNotificationImageCrop Énumération

Définition

Spécifie les options de rognage d’une image dans une appNotification.

public enum class AppNotificationImageCrop
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract, 65536)]
enum class AppNotificationImageCrop
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilderContract), 65536)]
public enum AppNotificationImageCrop
var value = Microsoft.Windows.AppNotifications.Builder.AppNotificationImageCrop.default
Public Enum AppNotificationImageCrop
Héritage
AppNotificationImageCrop
Attributs

Champs

Circle 1

Rognage circulaire.

Default 0

Par défaut. Pas de rognage.

Exemples

L’exemple suivant illustre la définition d’une image inline dans la charge utile XML pour une notification d’application.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .SetInlineImage(new Uri("ms-appx:///Images/InlineImage.png"), AppNotificationImageCrop.Circle, "Alternate text")
    .BuildNotification();

AppNotificationManager.Default.Show(notification);;

Charge utile XML résultante :

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
            <image src='ms-appx:///Images/InlineImage.png' alt='Alternate text' hint-crop='circle'/>
        </binding>
    </visual>
</toast>

Remarques

Définissez le rognage d’une image de notification d’application dans l’appel à AppNotificationBuilder.SetInlineImage.

S’applique à