How can display an image Profile for tweetinvi

406 Views Asked by At

I've tried it review images through GetProfileImageStream Next CODE

pic.Image = User.GetProfileImageStream(user, ImageSize.bigger);

In the language C# form !! out error

Severity Code Description Project File Line Suppression State
Error CS0029 Cannot implicitly convert type 'System.IO.Stream' to 'System.Drawing.Image'

What is the problem? Thank

1

There are 1 best solutions below

0
On

I know this is an old question but here is my solution I used to display my profile photo inside a button icon.

Auth.SetUserCredentials(TwitterSettings.ConsumerKey, TwitterSettings.ConsumerSecret, TwitterSettings.AccessToken, TwitterSettings.AccessTokenSecret);
var user = User.GetAuthenticatedUser();
var getProfilePic = user.GetProfileImageStream(Tweetinvi.Models.ImageSize.normal);
IDD_POST_TWEET.Iconimage = System.Drawing.Image.FromStream(getProfilePic);