Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9107479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:34:54+00:00 2026-06-17T02:34:54+00:00

I have a problem with converting some base64 string that I get from a

  • 0

I have a problem with converting some base64 string that I get from a dataset politely served by a webservice into an image and thereafter displaying it on a gridview.

My incoming data from a webservice

<NewDataSet xmlns="">
    <AvailableUsers diffgr:id="AvailableUsers1" msdata:rowOrder="0">
        <sUserId>1</sUserId>
        <UserDesc>Mr. Someone</UserDesc>
    </AvailableUsers>
    <AvailableUsers diffgr:id="AvailableUsers2" msdata:rowOrder="1" diffgr:hasChanges="modified">
        <sUserId>2</sUserId>
        <UserDesc>Mr. Someone 2</UserDesc>
        <UserIMG>
        // A base64 string is here but let's not bother ourselves with that here...
        </UserIMG>
    </AvailableUsers>
</NewDataSet>

My Image Adapter

class ImageAdapter : BaseAdapter
{
    Context context;

    public ImageAdapter(Context c)
    {
        context = c;
    }

    public override int Count
    {
        get { return thumbIds.Length; }
    }

    public override Java.Lang.Object GetItem(int position)
    {
        return null;
    }

    public override long GetItemId(int position)
    {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public override View GetView(int position, View convertView, ViewGroup parent)
    {
        ImageView imageView;

        if (convertView == null)
        {  // if it's not recycled, initialize some attributes
            imageView = new ImageView(context);
            imageView.LayoutParameters = new GridView.LayoutParams(150, 150);
            imageView.SetScaleType(ImageView.ScaleType.CenterCrop);
            imageView.SetBackgroundColor(Color.Aqua);
        }
        else
        {
            imageView = (ImageView)convertView;
        }

        imageView.SetImageResource(thumbIds[position]);
        return imageView;
    }

    int[] thumbIds = {
    Resource.Drawable.sample_0, Resource.Drawable.sample_1, Resource.Drawable.sample_2, Resource.Drawable.sample_3
};
}

Here is where my current knowledge and understanding stops (I am a newbie on the field – did some web stuff and light javascript before but nothing compared to this). I would politely ask someone to write me up an example or at least point me to a tutorial that actually dabbles in this specific problem.

Thank you for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:34:55+00:00Added an answer on June 17, 2026 at 2:34 am

    I resolved my problem by using a listvew and custom array adapter.

    As for the images:

    string base64 = item.UserIMG;
    
    if (item.UserIMG != null) // If there's actually a string inside item.UserIMG
    {
        System.IO.Stream s = new MemoryStream(Convert.FromBase64String(base64));
    
        byte[] arr = Convert.FromBase64String(base64);
        Drawable img = Drawable.CreateFromStream(s, null);
    
        ImageView UserAvatar = view.FindViewById<ImageView>(Resource.Id.imgView);
        UserAvatar.SetImageDrawable(img);
     }
     else  // If item.UserIMG is "" or null
        {
           ImageView UserAvatar = view.FindViewById<ImageView>(Resource.Id.imgView);
        }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem converting my data from an plist to objects. The plist
I have a problem converting a string binary to a decimal I was using
I have a problem while converting a string whose value is dd.mm.yyyy to DateTime
I have a weird problem in converting a string to double in .NET 3.5.
I am having trouble converting some code from VB6 to VB.NET (I don't have
I have some problem converting a MYSQL query to CI syntax. This my MySQL
I have problem, when converting Windows application from .NET2.0 to .NET3.5. I do this
Perhaps someone could provide some insight into a problem I have. I have a
I'm having a problem with converting some string short time values to a 24
I have a problem with converting raw-bytes values into java types. I am receiving

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.