< Back

New-BTImage

Sun Jan 12, 2020 7:35 pm

NAME New-BTImage



SYNOPSIS

Creates a new Image Element for Toast Notifications.





SYNTAX

New-BTImage [-Source <String>] [-AlternateText <String>] [-Align {Default | Stretch | Left | Center | Right}]

[-Crop {Default | None | Circle}] [-RemoveMargin] [-AddImageQuery] [-WhatIf] [-Confirm] [<CommonParameters>]



New-BTImage [-Source <String>] [-AlternateText <String>] -AppLogoOverride [-Crop {Default | None | Circle}]

[-AddImageQuery] [-WhatIf] [-Confirm] [<CommonParameters>]



New-BTImage [-Source <String>] [-AlternateText <String>] -HeroImage [-AddImageQuery] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

The New-BTImageElement function creates a new Image Element for Toast Notifications.



You can use the parameters of New-BTImageElement to specify the source image, alt text, placement on the Toast

Notification and crop shape.





PARAMETERS

-Source <String>

The URI of the image. Can be from your application package, application data, or the internet. Internet images

must be less than 200 KB in size.



Required? false

Position? named

Default value $Script:DefaultImage

Accept pipeline input? false

Accept wildcard characters? false



-AlternateText <String>

A description of the image, for users of assistive technologies.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-AppLogoOverride [<SwitchParameter>]

Specifies that the image is to be used as the logo on the toast.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-HeroImage [<SwitchParameter>]

Specifies that the image is to be used as the hero image on the toast.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Align

The horizontal alignment of the image. For Toast, this is only supported when inside a group (not yet

implemented.)



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Crop

Control the desired cropping of the image. Supported on Toast since Anniversary Update.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RemoveMargin [<SwitchParameter>]

By default, images have an 8px margin around them. You can remove this margin by including this switch.

Supported on Toast since Anniversary Update.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AddImageQuery [<SwitchParameter>]

Set to true to allow Windows to append a query string to the image URI supplied in the Tile notification. Use

this attribute if your server hosts images and can handle query strings, either by retrieving an image variant

based on the query strings or by ignoring the query string and returning the image as specified without the

query string. This query string specifies scale, contrast setting, and language.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None





OUTPUTS

AdaptiveImage

ToastGenericAppLogo

ToastGenericHeroImage





NOTES





Credit for most of the help text for this function go to the authors of the UWPCommunityToolkit library that

this module relies upon.



Please see the originating repo here: https://github.com/Microsoft/UWPCommunityToolkit



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$image1 = New-BTImage -Source 'C:\\Media\\BurntToast.png'



This command creates a standard image object to be included in the main body of a toast.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$image2 = New-BTImage -Source 'C:\\Media\\BurntToast.png' -AppLogoOverride -Crop Circle



This command creates an image object to be used as the logo on a toast, cropped into the shape fo a circle.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$image3 = New-BTImage -Source 'C:\\Media\\BurntToast.png' -HeroImage



This command creates an inmage to be used as a toast's hero image.











RELATED LINKS

https://github.com/Windos/BurntToast/bl ... BTImage.md