AppNotificationImageCrop Enumeration

Definition

Gibt die Zuschneideoptionen für ein Bild in einer AppNotification an.

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
Vererbung
AppNotificationImageCrop
Attribute

Felder

Circle 1

Kreisförmiges Zuschneiden.

Default 0

Standard. Kein Zuschneiden.

Beispiele

Im folgenden Beispiel wird das Festlegen eines Inlinebilds in der XML-Nutzlast für eine App-Benachrichtigung veranschaulicht.

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

AppNotificationManager.Default.Show(notification);;

Die resultierende XML-Nutzlast:

<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>

Hinweise

Legen Sie den Zuschnitt für ein App-Benachrichtigungsbild im Aufruf von AppNotificationBuilder.SetInlineImage fest.

Gilt für: