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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:50:32+00:00 2026-05-18T01:50:32+00:00

I wan’t to know the best method to load image asynchronously from Mysql in

  • 0

I wan’t to know the best method to load image asynchronously from Mysql in a WPF application.

Thanks.

  • 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-05-18T01:50:33+00:00Added an answer on May 18, 2026 at 1:50 am

    Use the ThreadPool to load the image from the database.

    • On the ThreadPool, queue the load of the image from the database;

    • When the image is loaded, still in the thread pool, convert the image into an ImageSource using BitmapFrame.Create();

    • Using Dispather.Invoke, set the Image property to the loaded image.

    So, something like this:

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        ThreadPool.QueueUserWorkItem(LoadImage, new LoadImageRequest { ImageName = "Image.png", Control = image1 });
    }
    
    private void LoadImage(object state)
    {
        var request = (LoadImageRequest)state;
    
        byte[] data = ...; // load bytes from the database using request.ImageName
    
        using (var stream = new MemoryStream(data))
        {
            var imageSource = BitmapFrame.Create(stream);
    
            Dispatcher.BeginInvoke(
                new Action<ImageSource>(p => request.Control.Source = p), imageSource
            );
        }
    }
    
    private class LoadImageRequest
    {
        public string ImageName;
        public Image Control;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Heey, Does anybody know how to start safari from a ipad application? I wan't
I wan't to know the real size of a web page (HTML + CSS
I wan't a method with which to find a string within another string. It
I wan to remove the last set of data from string using java. For
I wan to know, does Flash Player have limit on total memory used by
I wan to hide/show my caller id from my activity programmatically. I tried to
I wan't to change the background color of a div dynamicly using the following
I wan't to hide/show menuitems in a contextmenu using some propery of databound object.
A number of stored procedures I support query remote databases over a WAN. The
I wan to place a VB.NET project under Git control in Windows (was previously

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.