Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar / Image User in vb.net
Avatar
coopermine #1
Member since Sep 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Avatar / Image User in vb.net in matrix
Hi .. I am looking for any forum as I do to show the avatar in vb.net or c #. I'm using the gmail servers for connection. I searched a lot but not found,
This post was edited on 2013-10-15, 20:18 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The Avatar is the Photo which the user sets in the vcard. So look at the MiniClient example how to get the vcard. The vcard has a photo property which contains the picture when the user has set one.

Alex
Avatar
coopermine #3
Member since Sep 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
Is working well.

  1. If e.Iq.Type = Xmpp.IqType.result Then
  2.             Dim vc = TryCast(e.Iq.Query, Vcard)
  3.             txtName.Text = vc.Fullname
  4.             txtNickname.Text = vc.Nickname
  5.            
  6.             Dim Avatar as string = vc.Photo.ToString
  7.          
  8.             Dim email = vc.GetEmails().FirstOrDefault(Function(m) m.IsInternet)
  9.             If email IsNot Nothing Then
  10.                 txtEmail.Text = email.Address
  11.             End If
  12. End If


RESULT AVATAR.

  1. <PHOTO xmlns="vcard-temp">
  2.  <TYPE>image/jpeg</TYPE>
  3.  <BINVAL>/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUDBAgGBgYJCQsIBggGBwgJBgYGBwcHBwYIBgUGBwkGBgYIFhwXBwgaFQcGGCEYGh0dHx8fCBciJCIeJBweHx4BBQUFCAcIDwkJDxcUEhQWFRQSGBkXHxQWFRYUHhQZFR0UFB4UFB4UHhQeFBcUFBQUFBQUFBYUFBQUFBQUFBQUFP/AABEIAGAAYAMBIgACEQEDEQH/xAAdAAACAgMBAQEAAAAAAAAAAAAFBgQHAgMIAAEJ/8QARhAAAQIDAwgECwYCCwAAAAAAAgEDAAQSBREiBhMhMTJBQlJRYWLwBxRxcoGCkZKisbIjocLR0uFD8QgWJCUzU2SjwcPi/8QA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OUKwZ8ok/H2/C3GLq4YxVcIpvLQMGUy1//Z</BINVAL>
  4. </PHOTO>

I just can not convert this into System.Drawing.Image
This post was edited on 2013-10-15, 21:09 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
try

  1. If vc.Photo IsNot Nothing And vc.Photo.Image IsNot Nothing Then
  2.    Dim photo as Image = vc.Photo.Image
  3. End If
Avatar
coopermine #5
Member since Sep 2013 · 4 posts
Group memberships: Members
Show profile · Link to this post
Thx
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS