Ask a questionAsk a question
 

AnswerSuppress Image Placeholders in Webbrowser Control

  • Thursday, November 05, 2009 9:02 PMJohn Dabble Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is there a UI flag I can set to suppress image placeholders when an image is unavailable?  I'd prefer to have empty space vs. a dozen red [X] boxes floating around.

    TIA

    -John Dabble

Answers

  • Thursday, November 05, 2009 9:53 PMjeffdav Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    No, but you can turn off images completely.  You could also hack the resource in the DLL to be an empty image.
    • Marked As Answer byJohn Dabble Saturday, November 07, 2009 4:09 PM
    •  

All Replies

  • Thursday, November 05, 2009 9:53 PMjeffdav Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    No, but you can turn off images completely.  You could also hack the resource in the DLL to be an empty image.
    • Marked As Answer byJohn Dabble Saturday, November 07, 2009 4:09 PM
    •  
  • Monday, November 09, 2009 8:56 AMLivingston Samuel Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    You can a bind a function to the image's onerror event, which will replace the image with a alternate image to remove the redbox.

    eg. 

    Javascript:
    var handleImgError = function(e) {
    	e.src = "blank.gif";
    	return true;
    };
    
    
    HTML:
    <img src="images/testing.jpg" id="imgTest" onerror="handleImgError(this)" width="10" height="10" alt="testing" />
    

    this example will give you an idea how to get it working.

    the 'onerror' gets triggered when the image is not found in the path.