关于xps文档中的渲染变换 [英] regarding render transform in xps document

查看:107
本文介绍了关于xps文档中的渲染变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从字形&中删除渲染变换属性路径....

所以根据我必须更改其他属性,如剪辑,索引,originx,originy,数据,视图框,视口...

我使用以下fomulae为originx ,originy,fontrendering emsize ...


X origin =(Xorigin * transformOfGlyph.Value.M11 *

I need to remove render transform attribute from glyphs & paths....

So according to that i have to change other attributes like clip,indices,originx,originy,data, viewbox, viewport...

I used following fomulae for originx , originy,fontrendering emsize...

X origin = (Xorigin * transformOfGlyph.Value.M11 *   

transformOfCanvas.Value.M11)+

(YOrigin * transformOfGlyph.Value.M21 *

transformOfCanvas.Value.M21)+

transformOfGlyph.Value.OffsetX +

transformOfCanvas.Value.OffsetX;

Y origin =(Xorigin * transformOfGlyph.Value.M12 * transformOfCanvas.Value.M12)+

(YOrigin * transformOfGlyph.Value.M22 *

transformOfCanvas.Value.M22)+

transformOfGlyph.Value.OffsetY +

transformOfCanvas.Value.OffsetY;


transformOfCanvas.Value.OffsetY;


glyph.FontRenderingEmSize = glyph.FontRenderingEmSize *

glyph.RenderTransform.Value.M11;




这些公式运行良好。但我不知道这对所有人都有用...


我无法为字形和数据剪辑,视口,路径视图框架制作公式...

请帮我解决......



推荐答案

如果删除RenderTransform,您必须按照"向下推"的方式进行操作。通过将它们相乘来计算各个属性值。

对于Glyph,您需要考虑Clip,OriginX,OriginY,FontRenderingEmSize,OpacityMask和Fill属性。您不需要考虑Indices,因为此属性中的值是FontRenderingEmSize的百分之一。填充有点误导。如果Fill包含SolidColorBrush,则无需担心。如果它包含ImageBrush或VisualBrush,则必须调整Viewbox和Viewport属性。此外,对于VisualBrushes,您必须递归以将变换应用于Visual属性中的元素。如果Fill包含LinearGradientBrush,则必须调整渐变的StartPoint和EndPoint。如果Fill包含RadialGradientBrush,则必须调整渐变的Center,GradientOrigin,RadiusX和RadiusY。

对于Path,您需要通过Data属性向下递归以调整几何中的值。您还需要如上所述调整Fill,Stroke和OpacityMask画笔。还必须调整Clip,StrokeDashArray,StrokeDashOffset,StrokeMiterLimit和StrokeThickness。

在每种情况下,必须执行正确的矩阵乘法,以保留原始变换的旋转,剪切,倾斜和偏移特征。关于线性代数的好书可能会有所帮助。
If you remove RenderTransform you must, as you say, "push down" the calculations to the individual attribute values by multiplying them out.

For Glyphs, you need to consider Clip, OriginX, OriginY, FontRenderingEmSize, OpacityMask, and the Fill attributes. You don't need to consider Indices, because the values in this attribute are in hundredths of the FontRenderingEmSize. Fill is a little misleading. If the Fill contains a SolidColorBrush, you have nothing to worry about. If it contains an ImageBrush or VisualBrush, you must adjust the Viewbox and Viewport attributes. Also, for VisualBrushes you must recurse down to apply the transform to the elements in the Visual attribute as well. If the Fill contains a LinearGradientBrush you must adjust the StartPoint and EndPoint of the gradient. If the Fill contains a RadialGradientBrush, you must adjust the Center, GradientOrigin, RadiusX, and RadiusY of the gradient.

For Path, you need to recurse down through the Data attribute to adjust the values in the geometry. You also need to adjust the Fill, Stroke, and OpacityMask brushes as described above. Clip, StrokeDashArray, StrokeDashOffset, StrokeMiterLimit, and StrokeThickness must also be adjusted.

In each case, you must perform the correct matrix multiplication in order to preserve rotation, shear, skew, and offset characteristics of the original transform. A good book on linear algebra might be helpful here.


这篇关于关于xps文档中的渲染变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆