点击或拖拽改变大小

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.
继承层次
SystemObject
  SystemEventArgs
    DSkin.Html.Core.EntitiesHtmlImageLoadEventArgs

命名空间:  DSkin.Html.Core.Entities
程序集:  DSkin (在 DSkin.dll 中) 版本:16.6.3.22
语法
C#
public sealed class HtmlImageLoadEventArgs : EventArgs

HtmlImageLoadEventArgs 类型公开以下成员。

属性
  名称说明
公共属性Attributes
collection of all the attributes that are defined on the image element or CSS style
公共属性Handled
Indicate the image load is handled asynchronously. Cancel this image loading and overwrite the image asynchronously using callback method.
公共属性Src
the source of the image (file path, URL or inline data)
Top
方法
  名称说明
公共方法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(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.
公共方法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.
公共方法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.
公共方法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.
Top
扩展方法
  名称说明
公共扩展器方法FormatDateTime
将数据以时间格式并对其格式化
(由 ObjectExtenstions 定义。)
公共扩展器方法FormatNumber
将数据以数值方式对数据格式化
(由 ObjectExtenstions 定义。)
公共扩展器方法FormatString
将数据以字符串格式对数据格式化
(由 ObjectExtenstions 定义。)
公共扩展器方法Sleep
异步延迟执行代码,只能在主线程中调用
(由 DuiControlExtensions 定义。)
公共扩展器方法ToBool
将数据转换成Bool,如果转换失败返回False
(由 ObjectExtenstions 定义。)
公共扩展器方法ToDateTime
将数据转换成DateTime,如果转换失败返回空的时间
(由 ObjectExtenstions 定义。)
公共扩展器方法ToDouble
将数据转换成Double,如果转换失败返回0
(由 ObjectExtenstions 定义。)
公共扩展器方法ToEnumT
将数据转换成枚举,如果转换失败则返回默认值
(由 ObjectExtenstions 定义。)
公共扩展器方法ToFloat
将数据转换成Float,如果转换失败返回0
(由 ObjectExtenstions 定义。)
公共扩展器方法ToInt已重载。
将数据转换成int,如果转换失败返回0
(由 ObjectExtenstions 定义。)
公共扩展器方法ToInt(Int32)已重载。
数据转换成int,如果转换失败,返回errorResult
(由 ObjectExtenstions 定义。)
公共扩展器方法ToJson
将对象序列化成Json字符串
(由 JsonHelper 定义。)
公共扩展器方法ToLong
将数据转换成Long,如果转换失败返回0
(由 ObjectExtenstions 定义。)
Top
参见