68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using netDxf;
|
|
using netDxf.Tables;
|
|
|
|
namespace MetroGauges.Controls
|
|
{
|
|
public class BlockText : BaseShap
|
|
{
|
|
public BlockText(FrameworkElement shap) : base(shap)
|
|
{
|
|
}
|
|
|
|
public override void CopyBlock()
|
|
{
|
|
|
|
}
|
|
|
|
public override FrameworkElement DirectionShap(Point dirPoint)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void DrawDxfBlocks(DxfDocument dxf, Layer layer)
|
|
{
|
|
TextBlock textBlock = shapeitem as TextBlock;
|
|
Point point = (Point)textBlock.DataContext;
|
|
TextStyle style = new TextStyle("myStyle", "宋体");
|
|
netDxf.Entities.Text text = new netDxf.Entities.Text(textBlock.Text, new Vector2(point.X * m_ScaleRale,-point.Y * m_ScaleRale), textBlock.FontSize * m_ScaleRale, style);
|
|
text.Layer = layer;
|
|
text.Alignment = netDxf.Entities.TextAlignment.BottomLeft;
|
|
|
|
dxf.AddEntity(text);
|
|
|
|
}
|
|
|
|
public override List<Point> GetPoints()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public override void MoveBlock(Point currentPoint, Point dragPoint)
|
|
{
|
|
|
|
}
|
|
|
|
public override void MoveByX(double x)
|
|
{
|
|
|
|
}
|
|
|
|
public override void MoveByY(double y)
|
|
{
|
|
|
|
}
|
|
|
|
public override void ScaleBlock(double rate)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|