프로젝트

일반

사용자정보

개정판 92e69742

ID92e69742afa1eaa8d54512f0b8979e5ff7a5cbf3
상위 16231f58
하위 1588306f

백흠경이(가) 4달 전에 추가함

Fix: MARKUS 라인 사이즈를 PDF 라인 사이즈로 변경하는 로직 수정

Change-Id: I3d36d909d1f3e5b93ebbdbb35c5484c388a79e59

차이점 보기:

FinalService/KCOM_FinalService_DL/MarkupToPDF/Common/ConverterLineSize.cs
5 5

  
6 6
namespace MarkupToPDF.Common
7 7
{
8
    public class ConverterLineSize
8
    public static class ConverterLineSize
9 9
    {
10
        private static double[] factors = new double[11]{0.5, 0.5, 0.5, 0.5, 0.4, 0.3, 0.3, 0.3, 0.2, 0.2, 0.2};
11
        public static double Convert(int iLineSize)
10
        /// <summary>
11
        /// MARKUS 라인 사이즈를 PDF 라인 사이즈로 변환 
12
        /// </summary>
13
        /// <param name="iLineSize"></param>
14
        /// <param name="Scale">이미지 사이즈 / PDF 사이즈</param>
15
        /// <returns></returns>
16
        public static double Convert(int iLineSize, double Scale)
12 17
        {
13
            double factor = factors[iLineSize % 10];
18
            double factor = 1 / Scale;
14 19
            /// WPF defines a device-independent pixel as 1 / 96 per inch
15 20
            /// iTextSharp : "the default for the size of the unit in default user space (1/72 inch)
16 21
            return iLineSize * 72 / 96 * factor;
FinalService/KCOM_FinalService_DL/MarkupToPDF/Controls_PDF/DrawSet_Arc.cs
26 26
            contentByte.SetLineWidth((float)lineSize);
27 27
            contentByte.NewPath();
28 28

  
29

  
30 29
            contentByte.MoveTo((float)p1.X, (float)p1.Y);
31 30

  
32 31
            if (p2.Y >= p1.Y || p2.Y >= p3.Y)  //중간 Mid Point 는 Curve 특성에 대한 10 범위 내의 오차 적용
FinalService/KCOM_FinalService_DL/MarkupToPDF/Controls_PDF/DrawSet_Image.cs
56 56
            contentByte.RestoreState();
57 57
        }
58 58

  
59
        /// <summary>
60
        /// Sign을 그린다.
61
        /// </summary>
62
        /// <param name="startPoint"></param>
63
        /// <param name="endPoint"></param>
64
        /// <param name="pointSet"></param>
65
        /// <param name="contentByte"></param>
66
        /// <param name="UserID"></param>
67
        /// <param name="Angle"></param>
68
        /// <param name="opac"></param>
69
        /// <param name="projectNo"></param>
59 70
        public static void DrawSign(System.Windows.Point startPoint, System.Windows.Point endPoint, List<System.Windows.Point> pointSet, PdfContentByte contentByte, string UserID, double Angle, double opac, string projectNo)
60 71
        {
61 72
            contentByte.SaveState();
......
84 95
            using (System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBytes))
85 96
            {
86 97
                var midP = MathSet.getMiddlePoint(startPoint, endPoint);
98

  
87 99
                List<System.Windows.Point> tempPoint = new List<System.Windows.Point>();
88 100
                foreach (var item in pointSet)
89 101
                {
FinalService/KCOM_FinalService_DL/MarkupToPDF/MarkupToPDF.cs
198 198
            return (size / scaleWidth);
199 199
        }
200 200

  
201
        public List<Point> GetPdfPointSystem(List<Point> point)
201
        public List<Point> GetPdfPointSystem(List<Point> points)
202 202
        {
203
            List<Point> dummy = new List<Point>();
204
            foreach (var item in point)
205
            {
206
                dummy.Add(GetPdfPointSystem(item));
207
            }
208
            return dummy;
203
            return points.ConvertAll(x => GetPdfPointSystem(x));
209 204
        }
210 205

  
211 206
        public double returnAngle(Point start, Point end)
......
528 523
#endregion
529 524

  
530 525
        #region PDF
531
        public static float scaleWidth = 0;
532
        public static float scaleHeight = 0;
526
        public static float scaleWidth { get; set; } = 0;
527
        public static float scaleHeight { get; set; } = 0;
533 528

  
534 529
        private string SetFlattingPDF(string tempFileInfo)
535 530
        {
......
802 797
                                                            var PaintStyle = control.PaintState;
803 798
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
804 799
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
805
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
800
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
806 801
                                                            double Opacity = control.Opac;
807 802
                                                            DoubleCollection DashSize = control.DashSize;
808 803

  
......
826 821

  
827 822
                                                                var Opacity = control.Opac;
828 823
                                                                string UserID = control.UserID;
829
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
824
                                                                double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
830 825
                                                                bool IsTransOn = control.IsTransOn;
831 826

  
832 827
                                                                if (control.IsTransOn)
......
853 848
                                                        using (S_RectControl control = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
854 849
                                                        {
855 850
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
856
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
851
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
857 852
                                                            var PaintStyle = control.PaintState;
858 853
                                                            double Angle = control.Angle;
859 854
                                                            DoubleCollection DashSize = control.DashSize;
......
869 864
                                                        using (S_TriControl control = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
870 865
                                                        {
871 866
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
872
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
867
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
873 868
                                                            var PaintStyle = control.Paint;
874 869
                                                            double Angle = control.Angle;
875 870
                                                            //StrokeColor = _SetColor, //색상은 레드
......
886 881
                                                        using (S_CircleControl control = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
887 882
                                                        {
888 883
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
889
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
884
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
890 885
                                                            var StartPoint = GetPdfPointSystem(control.StartPoint);
891 886
                                                            var EndPoint = GetPdfPointSystem(control.EndPoint);
892 887
                                                            var PaintStyle = control.PaintState;
......
904 899
                                                        using (S_RectCloudControl control = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
905 900
                                                        {
906 901
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
907
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
902
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
908 903
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
909 904
                                                            double size = MathSet.DistanceTo(GetPdfPointSystem(control.StartPoint), GetPdfPointSystem(control.EndPoint));
910 905

  
......
938 933
                                                        using (S_CloudControl control = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
939 934
                                                        {
940 935
                                                            string[] data2 = control.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
941
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
936
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
942 937
                                                            double Toler = control.Toler;
943 938
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
944 939
                                                            double ArcLength = (control.ArcLength == 0 ? 10 : control.ArcLength) / (scaleWidth > scaleHeight ? scaleWidth : scaleHeight);
......
1067 1062
                                                            //   //testPoint = Test(rect, newMidPoint);
1068 1063
                                                            //}
1069 1064

  
1070
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1065
                                                            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
1071 1066
                                                            System.Drawing.Color FontColor = _SetColor;
1072 1067
                                                            bool isHighlight = control.isHighLight;
1073 1068
                                                            double Opacity = control.Opac;
......
1192 1187
                                                    case "SignControl":
1193 1188
                                                        using (S_SignControl control = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1194 1189
                                                        {
1195

  
1196 1190
                                                            double Angle = control.Angle;
1197 1191
                                                            Point StartPoint = GetPdfPointSystem(control.StartPoint);
1198
                                                            Point TopRightPoint = GetPdfPointSystem(control.TR);
1199 1192
                                                            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1200
                                                            Point LeftBottomPoint = GetPdfPointSystem(control.LB);
1201 1193
                                                            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1202 1194
                                                            double Opacity = control.Opac;
1203 1195
                                                            string UserNumber = control.UserNumber;
......
1539 1531
            Point EndPoint = GetPdfPointSystem(control.EndPoint);
1540 1532
            DoubleCollection DashSize = control.DashSize;
1541 1533
            List<Point> PointSet = GetPdfPointSystem(control.PointSet);
1542
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1534
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
1543 1535

  
1544 1536
            double Opacity = control.Opac;
1545 1537

  
......
1567 1559
            var Opacity = control.Opac;
1568 1560
            string UserID = control.UserID;
1569 1561
            double Interval = control.Interval;
1570
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()));
1562
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(InnerData.First()), scaleWidth);
1571 1563
            Controls_PDF.DrawSet_Line.DrawLine(StartPoint, EndPoint, LineSize, contentByte, control.DashSize, setColor, Opacity);
1572 1564
            switch (control.LineStyleSet)
1573 1565
            {
......
1652 1644
            }
1653 1645
            if (control.isHighLight) paint |= PaintSet.Highlight;
1654 1646

  
1655
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()));
1647
            double LineSize = Common.ConverterLineSize.Convert(Convert.ToInt32(data2.First()), scaleWidth);
1656 1648
            double TextSize = Convert.ToDouble(data2[1]);
1657 1649
            System.Drawing.Color FontColor = setColor;
1658 1650
            double Angle = control.Angle;
FinalService/KCOM_FinalService_DL/MarkupToPDF/Serialize/S_Control/Detail/S_CloudControl.cs
40 40

  
41 41
        [DataMember]
42 42
        public DoubleCollection DashSize { get; set; }
43

  
43 44
        public void Dispose()
44 45
        {
45 46
            GC.Collect();

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)