Delphi组件源码:HTML Component Library 3.9
delphi组件源码:HTML Component Library 3.9
HTML Component Library is a cross-patform and 100% native HTML rendering library for Delphi and Lazarus that brings all the power of HTML/CSS into desktop and mobile Delphi applications.
Unlike other «HTML-like» libraries it is based on powerful HTML/CSS rendering core with full support of HTML 4.1 and CSS 3 (some of HTML 5 tags are also supported). Tables, shadows, transitions, animations, SVG images, tranforms and much more.
No DLL’s, no ActiveX, no third party libraries dependencies, only pure native Delphi code.
Library is used by thousands of developers from 50 countries, and even by Delphi IDE (from version 11.2).
Compatibility
Library supports all Delphi versions from ancient Delphi 5 to Delphi 11 Alexandria. For Delphi XE4 - Delphi 11 Alexandria all FMX platforms are supported - Win32/64, OSX, Android, iOS and Linux.
Linux GUI is supported with FMXLinux library and in Lazarus
Unicode (including Right-to-Left) is supported even for non-unicode Delphi 5 - 2007 using widestrings and TNT Unicode library.
Updates for new Delphi versions are released in one week (max) after Delphi release.
Parts
Library core contains:
HTML parser with full support of HTML standard and ability to handle incorrect markup. It was tested on thousands of real-world emails so missed closed tags and incorrect tag order is not a problem. Also it is currently fastest native HTML parser for Delphi.
XML Parser with XPath support.
CSS parser with CSS 3 support.
DOM classes with JQuery support.
SVG rendering library.
HTTP client with native implementation for Windows and OSX and https support.
HTML rendering core.
Set of rendering canvases (GDI, GDI+, Direct2D, FMX, Android, iOS, OSX, Linux (Lazarus), Meta, Plain Text)
Set of HTML-enabled VCL controls including Label, Panel, ListBox, ComboBox, Tabs, CheckBox, RadioButton, SpeedButton, PopupMenu, ComboListBox, Virtual Tree, CategoryButtons, BalloonHint.
Powerful cross-platform scripting engine
Bundle also contains
Email framework
SQL framework
HTML rendering class is separated from drawing class so you can choose between available drawing classes or write your own. Currently library contains GDI, GDI+ and Direct2D canvases for VCL (All Delphi versions and Lazarus), FMX canvas for FMX Win32/64, iOS, Android and OSX and also native Android, iOS and OSX canvases.
Conversions
Following format conversions can be performed using the library on all platforms including mobiles and without external dependencies:
Convert HTML to PDF
Convert HTML to plain text
Convert HTML to images (JPEG, PNG, etc.).
Convert HTML to SVG
Convert RTF to HTML, PDF, images, SVG, plain text
Convert MS Word .DOCX to HTML, PDF, Images, SVG, plain text
Performance
Library core is heavily optimized and extremely fast. Parsing speed is about 100Mb/s so parsing of typical 100Kb document takes only 1ms. Style and layout calculations takes additional 20ms for 100Kb document.
Using of native canvas on Android provides smooth scrolling and zoom similar to native Android applications (much better than FMX controls) and correct text rendering with full RTL support, kerning pairs and baseline alignment.
How to use
Drop THtPanel on form and set it’s HTML property. That’s all you have to do to get HTML viewer with automatic scrollbars, build-in zoom support (Ctrl+Wheel or zoom gesture), gestures support for both VCL and FMX, picture loading (from file or internet) with BMP, JPEG, PNG, ICO and GIF support, hints (HTML title attribute) animations and transitons (for elements with :hover or :active styles).
To simply draw HTML on Canvas write
Doc := THtDocument.Create;
try
Doc.Parse(HTML);
Doc.Draw(Canvas, Rect);
finally
Doc.Free
end;
Why do I need it?
VCL and FMX contains a lot of powerful controls with many features. But what if you need something non-standard, for example put an image into listbox item?
Of course writing OnDraw event handler and using canvas methods is a simplest way... as long as image is not placed inside the text and text not contains several lines and some formatting. With HTML enabled list box you can just add Some text with <b>formatting</b> and <img src="myimage.png"/>image </p>
How many lines of code is neccesary to draw simple rounded rectangle with shadow and gradient? Or tiled background image Or symbol table Changing HTML property could turn simple Panel into this
相关文章
- 微信小程序官方组件展示之导航functional-page-navigator源码
- C++STL初识,概念、六大组件、容器算法迭代器
- 微信小程序官方组件展示之基础内容text源码
- 微信小程序外部如何控制组件样式
- 易语言画板组件实现自绘圆形进度条源码
- 微信小程序官方组件展示之表单组件picker源码
- 微信小程序官方组件展示之表单组件picker-view源码
- 试试使用 Vitest 进行组件测试,确实很香。
- 学用Hook写React组件——通用弹出层
- vue源码分析-组件
- vue源码分析-动态组件
- 微信小程序官方组件展示之媒体组件voip-room源码
- vue子组件调用父组件中方法的方式合集
- K8s源码分析(26)-Queue组件和DeltaFIFO组件
- 微信小程序官方组件展示之开放能力ad-custom源码
- SpringCloudAlibaba 微服务组件 Nacos 之配置中心源码深度解析
- vue子组件调用父组件父页面的方法「建议收藏」
- react源码分析--组件的创建和更新
- React源码学习入门(八)React组件挂载Component细节流程
- React源码学习入门(十二)DOM组件更新流程与Diff算法
- 兄弟组件传值
- Antd源码浅析(二)InputNumber组件 一
- Vue的beforeRouteEnter如何使用组件实例的方法
- 【Netty】NIO 通道 ( Channel ) 组件
- OpenStack Swift组件介绍
- 【Flutter】自定义 Flutter 组件 ( 创建自定义 StatelessWidget、StatefulWidget 组件 | 调用自定义组件 )
- 谷歌自锤Attention is all you need:纯注意力并没那么有用,Transformer组件很重要
- Spring Cloud Stream核心组件Source
- Linux安装组件:非常简单!(linux安装组件)
- Struts2 <Bean>元素:定义及示例化Bean组件
- 每日安全资讯:开源组件漏洞影响多个 CMS 系统
- .NET开发邮件发送功能的全面教程(含邮件组件源码)
- 三种禁用FileSystemObject组件的方法