Silverlight 3:将 XML 笔划集合转换回笔划集合?
我有一个 silverlight 应用程序,允许用户在其上绘图并保存绘图。
画布中的笔画集合被转换为xml属性并存储在数据库中。
我现在遇到的唯一问题是将 xml 转换回笔画集合。
我的笔画存储如下:
<Strokes>
<Stroke>
<Color A="255" R="0" G="0" B="0" />
<OutlineColor A="0" R="0" G="0" B="0" />
<Points>
<Point X="60" Y="57" PressureFactor="0.5" />
<Point X="332" Y="52" PressureFactor="0.5" />
</Points>
<Width>3</Width>
<Height>3</Height>
</Stroke>
</Strokes>
I have a silverlight app that allows the user to draw on it and save the drawing.
The strokecollection in the canvas is converted to xml attributes and stored in the database.
the only problem i have now is converting the xml back into a stroke collection.
my strokes are stored as such:
<Strokes>
<Stroke>
<Color A="255" R="0" G="0" B="0" />
<OutlineColor A="0" R="0" G="0" B="0" />
<Points>
<Point X="60" Y="57" PressureFactor="0.5" />
<Point X="332" Y="52" PressureFactor="0.5" />
</Points>
<Width>3</Width>
<Height>3</Height>
</Stroke>
</Strokes>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您的代码,经过严格考虑:-
Here is your code heavily factored:-
这是我的解决方案......在我真正坐下来查看它之前,我似乎认为它太混乱了:
Here is my solution... it appears I thought it was too confusing before I actually sat down and looked at it: