Updating a Profile Image

Sets user's profile image.
Signature:
public async Task<User> UpdateAccountImageAsync(
    byte[] image, string fileName, 
    string imageType, bool skipStatus)
public async Task<User> UpdateAccountImageAsync(
    byte[] image, string fileName, 
    string imageType, bool includeEntities, bool skipStatus)
Parameters/Filters:
Name Purpose Type Required
fileName Image file name string no
image Base64-encoded image byte[] yes
imageFilePath Image file path string no
imageType Image file type string no
includeEntities Include Twitter entities (default: true) bool no
skipStatus Exclude status information (default: false) bool no


Return Type: User
v3.0 Example:
            byte[] imageBytes = File.ReadAllBytes(@"..\..\Images\200xColor_2.png");

            var user = await twitterCtx.UpdateAccountImageAsync(
                imageBytes, "200xColor_2.png", "png", false);

            if (user != null)
                Console.WriteLine("User Image: " + user.ProfileImageUrl); 
v2.1 Example:
            var user = twitterCtx.UpdateAccountImage(@"..\..\images\200xColor_2.png");

            Console.WriteLine("User Image: " + user.ProfileImageUrl);

Twitter API: account/update_profile_image

Last edited Nov 29, 2013 at 3:12 AM by JoeMayo, version 19