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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:00:12+00:00 2026-05-28T02:00:12+00:00

When my page loads and I press button1 I can get the image and

  • 0

When my page loads and I press button1 I can get the image and can see it.

But when I click it second time it doesn’t work at all. I debugged it button1_Click(...) and I am sure that imageData != null.

I really can’t figure out what’s up… Please help me!

private void button1_Click(object button, RoutedEventArgs e)
{
    Guid sid = Guid.Parse("087462df-e4b6-484c-879e-cccc37b4c1f4");
    EntityQuery<Screenshot> screen = this._myDomainContext.GetScreenshotQuery(sid);
    this._myDomainContext.Load(screen).Completed += (sender, args) =>
    {
        try
        {
            byte[] imageData = (((LoadOperation<Screenshot>)sender).Entities.FirstOrDefault()).Screen;
            if (imageData != null)
            {
                BitmapImage img = Utilities.Graphics.GetImage(imageData);
                img.CreateOptions = BitmapCreateOptions.IgnoreImageCache;

                image1.Source = null;
                image1.Source = img;
            }
        }
        catch
        {
        }

    };
}

and

public static BitmapImage GetImage(byte[] rawImageBytes)
{
    BitmapImage imageSource = null;

    try
    {
        using (MemoryStream stream = new MemoryStream(rawImageBytes))
        {
            stream.Seek(0, SeekOrigin.Begin);
            BitmapImage b = new BitmapImage();
            b.SetSource(stream);
            imageSource = b;    
        }
    }
    catch  
    {
    }

    return imageSource;
}
  • 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-28T02:00:13+00:00Added an answer on May 28, 2026 at 2:00 am

    Try changing the overload of Load:

    
    this._myDomainContext.Load(screen, LoadBehavior.RefreshCurrent, true).Completed+= ...
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there way thats i can preselect an item when the page loads or
Is it possible to get the mouse position with JavaScript after page loads without
I seem to have a problem and can't get it work. I'm working on
everytime my page loads, im supposed to create a datatable (also a jquery plugin)
I would like to open a document after my ASP.NET page loads in a
How do I increment a step value to be processed when the page loads?
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
I'm building a webpage and I'm getting the following warning (and the page loads
I'm trying to animate a block level element using jQuery. The page loads with
I have a ChildUserControl that is loaded inside a ParentUserControl. The host page loads

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.