对于我的工作,我绘制了建筑尺寸,软件会创建2D草图like this
的.jpg文件问题在于,有时如果我没有放大足够近的软件,由于整体.jpg大小(大量空白区域),生成的.jpg会使草图模糊。
该软件还会生成一个.xml文件,其中包含草绘建筑的尺寸,标签和坐标点。我对XML很新,但我想知道如何使用XML中的数据来生成一个新的图像文件(jpg / png),它将删除空白区域,并且基本上使得resuting图像仅大到足以显示实际草图,like this.
下面显示了XML的片段,可以在其上方找到完整的XML。
感谢您的帮助。
http://codeshare.io/VUYsS
<SketchDocument DataVersion="1.28">
<Sketch1 Guid="fcc6d177-d3a4-4a01-af7f-2721bc0327ca" SketchMouseLocation="336.0,-7.0">
<Areas>
<Area1 Guid="4faa25cf-5aeb-47f4-97e4-b334c7ca4a8d" GLALevel="1" Category="Common Areas" ShowDimensionLabels="True" ShowCalulation="True" ShowName="True" Continuous="True" LivingArea="True" NegativeArea="False" NonCalculated="False" TackedTo="00000000-0000-0000-0000-000000000000" IsNestedArea="False" IsExteriorNestedArea="False">
<DimensionLabel Guid="4bbe3d57-aa5c-454f-80a8-17996e86fbb6" X="8.444992" Y="-91.37911" XOffset="-0.0" YOffset="-4.5499997" Visible="True" Rotation="0.0" RotationOverride="False" ParentRotation="0" Alignment="Center">
<Font ColorChanged="False" Color="ARGB(255,0,0,0)" Bold="False" Size="8" Underline="False" Family="Verdana" Italic="False" FontChanged="False"/>
<TextLines>814.8 Sq '</TextLines>
</DimensionLabel>
<NameLabel Guid="b3837229-f021-4a7b-9c89-2148ba9c6315" X="8.444992" Y="-91.37911" XOffset="-0.0" YOffset="4.5499997" Custom="True" Visible="True" Rotation="0.0" RotationOverride="False" ParentRotation="0" Alignment="Center">
<Font ColorChanged="False" Color="ARGB(255,0,0,0)" Bold="False" Size="8" Underline="False" Family="Verdana" Italic="False" FontChanged="False"/>
<TextLines>First Floor</TextLines>
</NameLabel>
<Lines>
<Line1 ArcHeight="-0.0" Guid="23e26249-5fae-459a-919b-f3086e8f878c" Width="3" Color="ARGB(255,0,0,0)" EndCap="Flat" HasUserRotation="True" StartCap="Flat" DashStyle="Solid">
<ArcHandle Width="1" LocationX="-43.75" LocationY="-3.8247463E-6"/>
<Label Y="8.719906" TackedTo="00000000-0000-0000-0000-000000000000" XOffset="0.0" Alignment="Center" X="-43.75" Visible="True" RotationOverride="False" ParentRotation="0" YOffset="0.0" Rotation="0">
<Font ColorChanged="False" Color="ARGB(255,0,0,0)" Bold="False" Size="6" Underline="False" Family="Verdana" Italic="False" FontChanged="False"/>
<TextLines>12.5 '</TextLines>
</Label>
<Start LocationX="0.0" LocationY="0.0"/>
<End LocationX="-87.5" LocationY="-7.6494925E-6"/>
</Line1>
<Line2 ArcHeight="-0.0" Guid="f2fbd11d-5b75-40ac-969b-f33b6c0eaa02" Width="3" Color="ARGB(255,0,0,0)" EndCap="Flat" HasUserRotation="True" StartCap="Flat" DashStyle="Solid">
<ArcHandle Width="1" LocationX="-87.5" LocationY="-99.750015"/>
<Label Y="-99.75" TackedTo="00000000-0000-0000-0000-000000000000" XOffset="0.0" Alignment="Center" X="-96.25861" Visible="True" RotationOverride="False" ParentRotation="0" YOffset="0.0" Rotation="0">
<Font ColorChanged="False" Color="ARGB(255,0,0,0)" Bold="False" Size="6" Underline="False" Family="Verdana" Italic="False" FontChanged="False"/>
<TextLines>28.5 '</TextLines>
</Label>
<Start LocationX="-87.5" LocationY="-7.6494925E-6"/>
<End LocationX="-87.5" LocationY="-199.50002"/>
</Line2>
....
...
..
.