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

  • Home
  • SEARCH
  • 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 8981243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:17:10+00:00 2026-06-15T20:17:10+00:00

I am developing a Windows 8 JavaScript app. I try to load image in

  • 0

I am developing a Windows 8 JavaScript app.

I try to load image in canvas but when I run the app directly using CTRL + F5 the app runs but there is no image on the canvas.

When I debug the app without placing a break point and the app directly opens but still there is no image.

When I debug the app and place a breakpoint then run the code step by step when the code for image generation is finished I continue debug by clicking on the debug sign and now the image shows up in the canvas. I’ve no idea what’s going on here why it is only showing the image on debug with breakpoint. Why it is not showing the image when I run it normally without debugging?

Here’s the code for image generation.

Init: function (canvas,ctx) {

    this.ghostCanvas = canvas;
    this.ghostCanvasCtx = ctx;

    var banner = new Image();
    banner.src = "images/banner.jpg";

    ctx.drawImage(banner, 100, 100);
}

This code works when I place a breakpoint and run it line by line. Also I am using two canvases one of top of the other. But the z-index of this canvas is greater so there should be no problem in that. What’s causing this problem?

  • 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-15T20:17:12+00:00Added an answer on June 15, 2026 at 8:17 pm

    You need to wait for the image to load before drawing it on the canvas. Add an event handler on your image object for the ‘load’ event, and when that is called then draw the image in the canvas.

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

Sidebar

Related Questions

I am developing the metro style windows 8 app using html,javascript and css. I
I am developing a windows 8 app(Metro) using html5, JavaScript, CSS, etc . I
I'm developing a windows store app using HTML and javascript. I need to login
I am developing a Windows 8 app with HTML5 and Javascript. I decided to
I am developing a metro app using JavaScript and am trying to display two
I'm developing a Cocoa app using XCode 4. One of the windows has a
I am developing web app using ASP.NET and i am also using javascript in
I'm developing a Windows application in VS2005 using C#. In my project, I generate
I'm developing a Windows Service in VB.NET 2008, but I feel like I'm going
I am developing a Windows Mobile app that my company is providing the devices

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.