Edit this page

Image Message

The usage of the ImageMessage is similar to the one of the GifMessage. The difference is that instead of passing a Uri source, the constructor accepts an Image source.

  • Author author
  • ImageSource source
  • [DateTime creationDate = default(DateTime)]

Example 1: Defining an ImageMessage

 ImageMessage imageMessage =
            new ImageMessage(this.currentAuthor, new BitmapImage(new Uri("/Images/dog.jpg", UriKind.RelativeOrAbsolute)));

Figure 1: Defining ImageMessage

Defining ImageMessage

Furthermore, the ImageMessage supports setting Stretch and Size for its image.

Example 2: Setting the Stretch and Size of the message

ImageMessage imageMessage =
            new ImageMessage(this.currentAuthor, new BitmapImage(new Uri("/Images/dog.jpg", UriKind.RelativeOrAbsolute)));

        imageMessage.Stretch = Stretch.Fill;
        imageMessage.Size = new Size(150, 90);

Figure 1: Defining ImageMessage

Defining ImageMessage

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy