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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:06:24+00:00 2026-06-04T11:06:24+00:00

I have a weird problem.. I am working on creating a thumbnail of a

  • 0

I have a weird problem..

I am working on creating a thumbnail of a webpage! I have never worked with threading and I have a issue

I am using the following code

protected void GetScreenshot_Click(object sender, EventArgs e)
{
  path = Server.MapPath(FolderID);
  Thread webBrowseThread = new Thread(new ThreadStart(PerformWebBrowseOp));
  webBrowseThread.SetApartmentState(ApartmentState.STA);
  webBrowseThread.Start();
}          

protected void PerformWebBrowseOp()
{
  if(searchedword!='')
  {
    Directory.CreateDirectory(path);
  }

  string path1 = Mypath + "/image.png";
  GeneateScreenshot gn = new GeneateScreenshot();
  Bitmap thumbnail = gn.GenerateScreenshot("http://www.google.com/search?hl=en&q=" + Searchedword, 1024, 768);
  FileStream imageStream = new FileStream(path1, FileMode.Create);
  thumbnail.Save(imageStream, System.Drawing.Imaging.ImageFormat.Png);
  imageStream.Close();
  downloadbutton.Visible=true;
}

now my problem is i have a download button to be displayed when the thumbnail has been created.. but for some reason the donwload button is not getting generated or is not visible!

I tried placing in the getscreenshot_click but it gets created even before the the thread has started running and before the thumbnail has been created.

Can someone help me fix this issue?

  • 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-04T11:06:26+00:00Added an answer on June 4, 2026 at 11:06 am

    The simplest way to solve this problem was to use webBrowseThread.join() to wait till the process is done and then say downloadbutton.visible= true !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird problem. I am working on a shared library, written using
I have this weird problem with setting up cookies with PHP. Everything worked fine
I have a weird problem with ExecuteQuery in that it isn't working when performing
ive got a really weird problem. i have no clue why its not working.
I have a weird problem with my setup that I don't understand. I'm working
I have weird problem on iOS5, on iOS6 it is working just fine :)
I have come across a weird problem when working with files in python. Let's
I have run into a rather weird problem. I have created the following query
Greetings folks. I have this weird problem. In the project I'm working on now,
OK guys, I have a weird problem, I have been using set_include_path before eaccelerator

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.