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.
Hereda de: EventArgs
Constructores
HtmlImageLoadEventArgs(string, Dictionary<string, string>, HtmlImageLoadCallback)
Init.
- src
- the source of the image (file path or Uri)
- attributes
- collection of all the attributes that are defined on the image element
- callback
- Callback used to allow setting image externally and async.
Propiedades
Attributes : Dictionary<string, string>
collection of all the attributes that are defined on the image element or CSS style
Métodos
Callback()
Callback to overwrite the loaded image with error image. Can be called directly from delegate handler or asynchronously after setting Handled to True.
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.
- 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 an image loaded from the given URI. This method can be invoked directly from a delegate handler or asynchronously after setting Handled to true. Only the specified rectangle defined by (x, y, width, height) will be used from the loaded image; the actual size of the image is ignored. The specified rectangle is used for sizing purposes.
- path
- The path to the image to load (file path or URL).
- x
- The x-coordinate of the top-left corner of the rectangle.
- y
- The y-coordinate of the top-left corner of the rectangle.
- width
- The width of the rectangle.
- height
- The height of the rectangle.
Callback(ImageSource)
Callback to overwrite the loaded image with given image object. Can be called directly from delegate handler or asynchronously after setting Handled to True.
- image
- the image to load
Callback(ImageSource, 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.
- image
- the image to load
- x
- The x-coordinate of the top-left corner of the rectangle.
- y
- The y-coordinate of the top-left corner of the rectangle.
- width
- The width of the rectangle.
- height
- The height of the rectangle.
Campos
_attributes : Dictionary<string, string>
collection of all the attributes that are defined on the image element
_callback : HtmlImageLoadCallback
Callback used to allow setting image externally and async.