HtmlRenderMeasureGdiPlus 方法 |
Measure the size (width and height) required to draw the given html under given max width restriction.
If no max width restriction is given the layout will use the maximum possible width required by the content,
it can be the longest text line or full image width.
Use GDI+ text rending, use
TextRenderingHint to control text rendering.
命名空间:
DSkin.Html
程序集:
DSkin (在 DSkin.dll 中) 版本:16.6.3.22
语法 public static SizeF MeasureGdiPlus(
Graphics g,
string html,
float maxWidth = 0f,
CssData cssData = null,
EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null,
EventHandler<HtmlImageLoadEventArgs> imageLoad = null
)
参数
- g
- 类型:System.DrawingGraphics
Device to use for measure - html
- 类型:SystemString
HTML source to render - maxWidth (Optional)
- 类型:SystemSingle
optional: bound the width of the html to render in (default - 0, unlimited) - cssData (Optional)
- 类型:DSkin.Html.CoreCssData
optional: the style to use for html rendering (default - use W3 default style) - stylesheetLoad (Optional)
- 类型:SystemEventHandlerHtmlStylesheetLoadEventArgs
optional: can be used to overwrite stylesheet resolution logic - imageLoad (Optional)
- 类型:SystemEventHandlerHtmlImageLoadEventArgs
optional: can be used to overwrite image resolution logic
返回值
类型:
SizeFthe size required for the html
参见