You are here: MessengerYouLike.IMSDK > Tutorials > Display Picture Management > Update Display Picture
MessengerYouLike
Update Display Picture

How to Change the Display Picture

  1. Complete Login User

 

 

  1. Now Call the Asynchronous function IMSDK.IMClient.UpdateDisplayPicture

 

[Visual Basic]
    Private Sub llbChangeDisPic_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles llbChangeDisPic.LinkClicked
        If OfdDisPic.ShowDialog = Windows.Forms.DialogResult.OK Then
            IMC.UpdateDisplayPicture(OfdDisPic.FileName, 66, 63)
        End If
    End Sub

 

 

 

 

  1. When Image is compressed and saved to the local Storage Resource then event IMSDK.IMClient.OnDisplayPictureUpdated is fired

 

[Visual Basic]
    Private Sub IMC_OnDisplayPictureUpdated(ByVal ImagePath As String) Handles IMC.OnDisplayPictureUpdated
        'Get The Loggedin user Display picture if any
        If Not String.IsNullOrEmpty(IMC.GetDisplayPicture) Then
            picUserDisPic.ImageLocation = IMC.GetDisplayPicture
        End If
    End Sub

 

 

 

  1. All Online Friends are notified of this changed via the event IMSDK.IMClient.OnFriendDisplayPictureUpdated

 

[Visual Basic]
Private Sub IMC_OnFriendDisplayPictureUpdated(ByVal FriendUsername As String, ByVal DisplayPicturePath As String) Handles IMC.OnFriendDisplayPictureUpdated
        Debug.WriteLine("Friend :" & FriendUsername & " Display picture Updated")
End Sub
You are here: MessengerYouLike.IMSDK > Tutorials > Display Picture Management > Update Display Picture
Copyright (c) 2007. All rights reserved.