프로젝트

일반

사용자정보

개정판 83d916a3

ID83d916a3df981d9686cca66232bab69a6b9854f1
상위 bd1ad756
하위 a6b02958

이지연이(가) 5년 이상 전에 추가함

issue #923: 이미지 생성 오류

Change-Id: Ic009eb2c5d7281c3ecb7ce3dc82970d21f9beb42

차이점 보기:

KCOM/Events/Implementation/TopMenuEvent.cs
1720 1720
        }
1721 1721
        #endregion
1722 1722

  
1723
        private void ImageConverter()
1723
        private void ImageConverter(RadToggleButton instanceToggle)
1724 1724
        {
1725
            var instanceMain = this.ParentOfType<MainWindow>();
1726
            //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1727

  
1725
            try
1726
            {           
1727
                var instanceMain = this.ParentOfType<MainWindow>();
1728
                //http://cloud.devdoftech.co.kr:5977/ImageUpload/FileUpload.asmx
1728 1729

  
1729
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1730
            dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1731
            Nullable<bool> result = dlg.ShowDialog();
1732
            if (result == true)
1733
            {
1734
                instanceMain.dzMainMenu.filename = dlg.FileName;
1735
                instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1730
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
1731
                dlg.Filter = "All files (*.*)|*.*|PNG Images (*.png)|*.png";
1732
                Nullable<bool> result = dlg.ShowDialog();
1733
                if (result == true)
1734
                {
1735
                    instanceMain.dzMainMenu.filename = dlg.FileName;
1736
                    instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
1736 1737

  
1737
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1738
                String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1739
                long numByte = fileInfo.Length;
1740
                double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1741
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1738
                    System.IO.FileInfo fileInfo = new System.IO.FileInfo(instanceMain.dzMainMenu.filename);
1739
                    String strFile = System.IO.Path.GetFileName(instanceMain.dzMainMenu.filename);
1740
                    long numByte = fileInfo.Length;
1741
                    double dLen = Convert.ToDouble(fileInfo.Length / 1000000);
1742
                    kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
1742 1743

  
1743
                if (dLen < 4)
1744
                {
1745
                    System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1746
                    System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1747
                    byte[] data = br.ReadBytes((int)numByte);
1748
                    br.Close();
1744
                    if (dLen < 4)
1745
                    {
1746
                        System.IO.FileStream fStream = new System.IO.FileStream(instanceMain.dzMainMenu.filename, System.IO.FileMode.Open, System.IO.FileAccess.Read);
1747
                        System.IO.BinaryReader br = new System.IO.BinaryReader(fStream);
1748
                        byte[] data = br.ReadBytes((int)numByte);
1749
                        br.Close();
1750

  
1751
                        string filepath = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1752
                        Uri uri;
1753
                        if (!(Uri.TryCreate(filepath, UriKind.Absolute, out uri) && uri.Scheme == Uri.UriSchemeHttp))
1754
                        {
1755
                            throw new Exception();
1756
                        }
1757
                        instanceMain.dzMainMenu.filename = filepath;
1749 1758

  
1750
                    instanceMain.dzMainMenu.filename = fileUploader.Run(App.ViewInfo.ProjectNO, instanceMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile, data);
1751
                    fStream.Close();
1752
                    fStream.Dispose();
1753
                }
1754
                else
1755
                {
1756
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1759
                        fStream.Close();
1760
                        fStream.Dispose();
1761
                    }
1762
                    else
1763
                    {
1764
                        this.ParentOfType<MainWindow>().DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert");
1765
                    }
1757 1766
                }
1758 1767
            }
1768
            catch(Exception ex)
1769
            {
1770
                instanceToggle.IsChecked = false;
1771
                Common.ViewerDataModel.Instance.SelectedControl = "";
1772
                Common.ViewerDataModel.Instance.ControlTag = null;
1773
                this.ParentOfType<MainWindow>().dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.None;
1774
                this.ParentOfType<MainWindow>().dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
1775
                this.ParentOfType<MainWindow>().DialogMessage_Alert(""+ ex , "Alert");
1776
            }
1759 1777
        }
1760 1778

  
1761 1779
        private void Control_Init(RadToggleButton instanceToggle, object sender)
......
2088 2106
                    case "Image":
2089 2107
                        Common.ViewerDataModel.Instance.SelectedControl = "ImgControl";
2090 2108
                        instanceMain.dzMainMenu.controlType = MarkupToPDF.Controls.Common.ControlType.ImgControl;
2091
                        ImageConverter();
2109
                        ImageConverter(instanceToggle);
2092 2110
                        break;
2093 2111
                    #endregion
2094 2112
                    #region Sign

내보내기 Unified diff

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