skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • AI Coding Assistants
    • Embedded Reporting
    • Document Processing Libraries
    • SSO Account Sign-in

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class HtmlImageLoadEventArgs

Invoked when an image is about to be loaded by file path, URL or inline data in 'img' element or background-image CSS style.
Allows to overwrite the loaded image by providing the image object manually, or different source (file or URL) to load from.
Example: image 'src' can be non-valid string that is interpreted in the overwrite delegate by custom logic to resource image object
Example: image 'src' in the html is relative - the overwrite intercepts the load and provide full source URL to load the image from
Example: image download requires authentication - the overwrite intercepts the load, downloads the image to disk using custom code and provide file path to load the image from. Can also use the asynchronous image overwrite not to block HTML rendering is applicable.
If no alternative data is provided the original source will be used.

Inheritance
System.Object
System.EventArgs
HtmlImageLoadEventArgs
Inherited Members
System.EventArgs.Empty
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TheArtOfDev.HtmlRenderer.Core.Entities
Assembly: Telerik.WinControls.RadMap.dll

Syntax

public sealed class HtmlImageLoadEventArgs : EventArgs

Properties

Attributes

collection of all the attributes that are defined on the image element or CSS style

Declaration
public Dictionary<string, string> Attributes { get; }
Property Value
System.Collections.Generic.Dictionary<System.String, System.String>

Handled

Indicate the image load is handled asynchronously. Cancel this image loading and overwrite the image asynchronously using callback method.

Declaration
public bool Handled { get; set; }
Property Value
System.Boolean

Src

the source of the image (file path, URL or inline data)

Declaration
public string Src { get; }
Property Value
System.String

Methods

Callback()

Callback to overwrite the loaded image with error image.
Can be called directly from delegate handler or asynchronously after setting Handled to True.

Declaration
public void Callback()

Callback(Object)

Callback to overwrite the loaded image with given image object.
Can be called directly from delegate handler or asynchronously after setting Handled to True.
If imageRectangle is given (not Empty) then only the specified rectangle will be used from the loaded image and not all of it, also the rectangle will be used for size and not the actual image size.

Declaration
public void Callback(object image)
Parameters
System.Object image

the image to load

Callback(Object, Double, Double, Double, Double)

Callback to overwrite the loaded image with given image object.
Can be called directly from delegate handler or asynchronously after setting Handled to True.
Only the specified rectangle (x,y,width,height) will be used from the loaded image and not all of it, also the rectangle will be used for size and not the actual image size.

Declaration
public void Callback(object image, double x, double y, double width, double height)
Parameters
System.Object image

the image to load

System.Double x

optional: limit to specific rectangle of the image and not all of it

System.Double y

optional: limit to specific rectangle of the image and not all of it

System.Double width

optional: limit to specific rectangle of the image and not all of it

System.Double height

optional: limit to specific rectangle of the image and not all of it

Callback(String)

Callback to overwrite the loaded image with image to load from given URI.
Can be called directly from delegate handler or asynchronously after setting Handled to True.

Declaration
public void Callback(string path)
Parameters
System.String path

the path to the image to load (file path or URL)

Callback(String, Double, Double, Double, Double)

Callback to overwrite the loaded image with image to load from given URI.
Can be called directly from delegate handler or asynchronously after setting Handled to True.
Only the specified rectangle (x,y,width,height) will be used from the loaded image and not all of it, also the rectangle will be used for size and not the actual image size.

Declaration
public void Callback(string path, double x, double y, double width, double height)
Parameters
System.String path

the path to the image to load (file path or URL)

System.Double x

optional: limit to specific rectangle of the image and not all of it

System.Double y

optional: limit to specific rectangle of the image and not all of it

System.Double width

optional: limit to specific rectangle of the image and not all of it

System.Double height

optional: limit to specific rectangle of the image and not all of it

Extension Methods

SvgExtentions.Traverse<T>(T, Func<T, IEnumerable<T>>)
SvgExtentions.TraverseDepthFirst<T>(T, Func<T, IEnumerable<T>>)
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.