HTML的Form和XFORM的区别,HTML_PAINT_XFORM structure

HTML_PAINT_XFORM structure

08/15/2017

閱讀時間 3 分鐘

本文內容

Represents matrices in the HTML_PAINT_DRAW_INFO structure for transforming or translating a rendering behavior's display output when the behavior supports transformations.

Syntax

typedef struct _HTML_PAINT_XFORM {

FLOAT eM11;

FLOAT eM12;

FLOAT eM21;

FLOAT eM22;

FLOAT eDx;

FLOAT eDy;

} HTML_PAINT_XFORM;

Members

eM11

Member of a transformation matrix. For details, see Remarks.

eM12

Member of a transformation matrix. For details, see Remarks.

eM21

Member of a transformation matrix. For details, see Remarks.

eM22

Member of a transformation matrix. For details, see Remarks.

eDx

Translation amount in the horizontal direction.

eDy

Translation amount in the vertical direction.

Remarks

When a rendering behavior has indicated it supports tranformations, MSHTML will supply transformation values in an HTML_PAINT_XFORM structure. This structure is available to the rendering behavior during MSHTML calls to the behavior's implementation of IHTMLPainter::Draw. The behavior retrieves this structure by calling IHTMLPaintSite::GetDrawInfo. (A rendering behavior must specify the HTMLPAINT_DRAWINFO_XFORM flag when calling IHTMLPaintSite::GetDrawInfo to retrieve transformation information.) This method retrieves data to an HTML_PAINT_DRAW_INFO structure that itself contains the HTML_PAINT_XFORM structure.

Note  A rendering behavior indicates that it supports transformations by implementing IHTMLPainter::GetPainterInfo so that it sets the HTMLPAINTER_SUPPORTS_XFORM flag in the lFlags member of the HTML_PAINTER_INFO* pInfo parameter. MSHTML calls IHTMLPainter::GetPainterInfo to determine the rendering behavior's capabilities and requirements. If a rendering behavior does not support transformations, the behavior will not be drawn under some circumstances—when a IHTMLRuleStyle3::zoom style is applied to the region containing the rendering behavior, for instance.

When implementing IHTMLPainter to support transformations, it is not necessary to know the kind of tranformation because MSHTML supplies the values. The implementer's responsibility is to retrieve the structure and add or multiply its values by the x- and y- coordinates being drawn, according to the following formulas.

The HTML_PAINT_XFORM structure offers two ways to alter how a behavior renders its shapes: transformation and translation. Transformations are applied before translation.

Transformations are of four types: scaling, rotation, shear, and reflection.

The four values eM11, eM12, eM21, and eM22 can be thought of as members of a 2 x 2 transformation matrix, T.

0861f3e1e334be35b94fdcda56a5dd66.gif

The vector for the coordinates of the original point is multiplied by this transformation matrix to calculate the coordinates of the transformed point.

e610a4fe8142b330e215806b987d6cd8.gif

The kind of transformation—scaling, rotation, shear, or reflection—is determined by the values for eM11, eM12, eM21, and eM22.

A scaling transformation stretches or shrinks a shape in the horizontal and vertical direction. The general form is shown in the following equation.

9a7f6374fd46f3491c8b87fd5a9bf4ac.gif

where h and v are the multipliers for the horizontal and vertical directions respectively. A value greater than 1 enlarges a shape in that direction. A value less than 1 shrinks it.

A rotation transformation rotates a shape around the origin by a specified angle in a clockwise direction. The general form is shown in the following equation.

0a6ae6303e98bd746377796a9f0e5d7d.gif

where a is the angle of rotation.

A reflection transformation flips a shape around a line, creating a mirror image of the shape on the other side of the line. The general form is shown in the following equation.

2aa32a275d0ed556ac12ba37b299de16.gif

where w is the clockwise angle between the x-axis and the line of reflection passing through the origin.

A shear transformation deforms a shape by tilting it over or stretching it into a parallelogram, much like the way italics tilt plain text.The general form is shown in the following equation.

bd1be749cc79ba40fad34e339c4c498e.gif

Translations shift a shape by specified amounts in the horizontal (eDx) and vertical (eDy) directions. In matrix terms, the values eDx and eDy form a 1 x 2 matrix (or vector) that is added to the vector for the original coordinates to calculate the translated coordinates, as shown in the following equation.

2c54b2e2d81a4d839ea32e0b0d61de57.gif

Here, x and y are the original coordinates of any point in the shape, and x' and y' are the coordinates for the translated point as it will be rendered.

The tranformation and translation can also be represented as an affine transformation using a single 3 x 3 affine matrix, as shown in the following equation.

d16382b5982209e69a9ed5e6412278db.gif

The following shows the complete equation.

f15a472b37fc8da687efe87ba555939e.gif

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值