HtmlRenderRenderGdiPlus 方法 (Graphics, String, PointF, SizeF, CssData, EventHandlerHtmlStylesheetLoadEventArgs, EventHandlerHtmlImageLoadEventArgs) |
Renders the specified HTML source on the specified location and max size restriction.
Use GDI+ text rending, use
TextRenderingHint to control text rendering.
If
maxSize.Width is zero the html will use all the required width, otherwise it will perform line
wrap as specified in the html
If
maxSize.Height is zero the html will use all the required height, otherwise it will clip at the
given max height not rendering the html below it.
Returned is the actual width and height of the rendered html.
命名空间:
DSkin.Html
程序集:
DSkin (在 DSkin.dll 中) 版本:16.6.3.22
语法 public static SizeF RenderGdiPlus(
Graphics g,
string html,
PointF location,
SizeF maxSize,
CssData cssData = null,
EventHandler<HtmlStylesheetLoadEventArgs> stylesheetLoad = null,
EventHandler<HtmlImageLoadEventArgs> imageLoad = null
)
参数
- g
- 类型:System.DrawingGraphics
Device to render with - html
- 类型:SystemString
HTML source to render - location
- 类型:System.DrawingPointF
the top-left most location to start render the html at - maxSize
- 类型:System.DrawingSizeF
the max size of the rendered html (if height above zero it will be clipped) - 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 actual size of the rendered html
参见