You are here: MessengerYouLike.IMSDK > IMSDK Reference > IMSDK Namespace > Classes > IMClient Class > IMClient Methods > IMClient.GetFriendUpdatedDisplayPicture Method
MessengerYouLike
IMClient.GetFriendUpdatedDisplayPicture Method

This Method Allows Users to Get Contact's Display Picture

C#
public GetFriendUpdatedDisplayPicture(String Friendusername);
Visual Basic
Public Sub GetFriendUpdatedDisplayPicture(ByVal Friendusername As String)

If the property IMSDK.Friends.MFriend.DisplayPictureLastUpdatedOn is same as on the server then this method will not update any display picture nor will server return any picture information as the picture will be the recent one when there is a new display picture only then this method will update the display picture and also update the property IMSDK.Friends.MFriend.DisplayPicturePath

[Visual Basic]
 
'Create a new IMClient
Dim MC as new IMSDK.IMClient
 
 
 
'Call the Listen Sub
MC.Listen()
 
 
 
'Now Try to login
MC.BeginLogin(TxtUsername.Text,TxtPassword.Text)
 
 
 
'if username and password is valid then
Private Sub MC_OnLoggedin(ByVal UserObject As IMSDK.User) Handles MC.OnLoggedin
    Debug.WriteLine("Username logged in : " & MCUser.Username & " , " & MCUser.Password)
End Sub
 
 
 
'if username or password is invalid then
Private Sub MC_OnUsernameOrPasswordInvalid(ByVal Username As String, ByVal Password As String) Handles MC.OnUsernameOrPasswordInvalid
  Debug.WriteLine("Username password invalid : " & Username & " , " & Password)
End Sub
 
 
 
 
'Get DisplayPicture
 
    Private Sub UpdateDisplayPictureToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateDisplayPictureToolStripMenuItem.Click
        Try
            Dim fr As MessengerYouLike.IMSDK.Friends.MFriend
 
 
            fr = IMC.FindContactListFriend(tvwfriends.SelectedNode.Tag.ToString)
            If fr Is Nothing Then
                Exit Sub
            End If
 
            IMC.GetFriendUpdatedDisplayPicture(fr.FriendUsername)
 
        Catch ex As Exception
 
        End Try
    End Sub
Copyright (c) 2007. All rights reserved.