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 9176657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:09:14+00:00 2026-06-17T17:09:14+00:00

I want to load local html file which in the local folder to the

  • 0

I want to load local html file which in the local folder to the webview, but WebView doesn’t support ‘ms-aspx:///’ protocal, I found a solution to read the html file to stream, and then convert it to string, using NavigateToString method to load the html, it works well. But, If there’s an image in the html file, the image couldn’t display, anyone can help?

  • 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-17T17:09:15+00:00Added an answer on June 17, 2026 at 5:09 pm

    I have solved.

    Solution:

    Convert the image file to base64 string

    StorageFolder appFolder = ApplicationData.Current.LocalFolder;
            StorageFile file = await appFolder.GetFileAsync("SplashScreen.png");
            using (var stream = await file.OpenAsync(FileAccessMode.Read))
            {
                var reader = new DataReader(stream.GetInputStreamAt(0));
                var bytes = new byte[stream.Size];
                await reader.LoadAsync((uint)stream.Size);
                reader.ReadBytes(bytes);
                base64 = Convert.ToBase64String(bytes);
            }
    

    Use StringBuilder to create the html string

    sb.Append("<html><head><title>Image test</title></head><body><p>This is a test app!</p><img src=\"data:image/png;base64,");
            sb.Append(base64);
            sb.Append("\" /></body></html>");
            TestWebView.NavigateToString(sb.ToString());     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load a local jqmobile html file into a webview. I am
I have a WebView. I want to load a local HTML file called helloworld.html.
I want to load a local file, example.pages in UIWebview. I tried with this
I have a WebView that loads a local HTML file like this: [webView loadRequest:[NSURLRequest
I use this line of code to load a local html file into a
I'm new to Android development. I want to load a html file into a
I want to download a page and show this in WEBVIEW local, but the
I want to load PNG-file from resources. There is a roughly MFC-way (with CResourceStream
I want to load multiple variables into one .mat file at the end of
I have a ajax image upload script which i found here http://www.fengcool.com/2009/06/ajax-form-upload-local-image-file-without-refresh/ The problem

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.