From 6f3c43b792fe6cef8bdd52c56dbafe1e58ffff03 Mon Sep 17 00:00:00 2001 From: "Culak-HP\\Culak" Date: Sun, 8 Nov 2020 19:43:44 +0100 Subject: [PATCH] ukladanie roznych typov nacitanych suborov ako jpg --- .vs/Mip_v1/v16/.suo | Bin 172544 -> 172544 bytes Mip/frmPridatVyrobok.Designer.cs | 82 ++++---- Mip/frmPridatVyrobok.cs | 176 +++++++++++++----- Mip/frmPridatVyrobok.resx | 2 +- .../Debug/Mip.Properties.Resources.resources | Bin 592435 -> 592435 bytes .../Mip.csproj.ResolveComReference.cache | Bin 810 -> 810 bytes Mip/obj/Debug/Mip.frmPridatVyrobok.resources | Bin 532 -> 532 bytes 7 files changed, 170 insertions(+), 90 deletions(-) diff --git a/.vs/Mip_v1/v16/.suo b/.vs/Mip_v1/v16/.suo index f74a83edee5de174559899ba05e0d086c6aa699c..a14906bfc81675307a45962c66826ca86e2e2b0f 100644 GIT binary patch delta 3959 zcmdUxdr;KZ7035nc5zu&|qM~T1vGIvbeIzs>595P`1+8V& zsM)LDYBb`GSq)+u_owWPNeqonhuDlo+sU+@#8Oj9)0ik0HKMZpUi^_jj5B@YpI+v} zIrrT2yRUQ3Z-2Ja2HR=Fwuxa2H5!c$^m;rV2n~V7;3qub;@qR915aAlWLQ8*}~Ab zs=>*0;@p=2m*_M^p{uKAFn*s<_GyS2muD*4=lh0^1)buP}cUvG8~@%vD9ROZmj=JFbiQA0{VmbHS~eO zOh#X(^aF#5@h8Be;KyJV$O69L86Y?N2xNe&r$|{Vt!i7K4)n+Py4rsZvK0Iglmod5 z*;YWW0F|H`NZU%t7r-j82FPrv0XG27s+kL9Hms8%L%7y($fp^KoU~UtZupG&9)tft zlX0rfZVjdl%5dxBq?3MM@sgxCT{fopye|bClR^vrgx*!q1+IaA0_i&jaxJ(8(DjVR zTIs6Zt4e7n*rjv?``I(A*aqS&Gke)#h)MN&85-H_?^IExQoUq4@l)?UcAp;=Dz_F6 zVU7gv!H(P(X;#e1P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OcR#ihhE^Q z@ZKfNf%o{A9;V8=UL<|Z3%$Kwl*kgZV>~~HMmdOEg5?pp!<>}D!i{fXPTUlZb4l$b zb20t9PXYP-$N1)QulRn{UNrDT=+y2HY3|s}(XZPPl4ma7 z7Wnp{3Q14q@%HtVtq~e^o_A8<)ReAYyHw!`G6X(esDeLEQtn&7aqWWj4UP3AVAVV} V^Gi?nvlp`icD;**(Ysk>{}XCdi2wiq diff --git a/Mip/frmPridatVyrobok.Designer.cs b/Mip/frmPridatVyrobok.Designer.cs index cd3b9dd..a3cce02 100644 --- a/Mip/frmPridatVyrobok.Designer.cs +++ b/Mip/frmPridatVyrobok.Designer.cs @@ -28,10 +28,10 @@ /// private void InitializeComponent() { - Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings messageBoxSettings1 = new Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings(); - Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings pdfViewerPrinterSettings1 = new Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings(); + Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings messageBoxSettings2 = new Syncfusion.Windows.Forms.PdfViewer.MessageBoxSettings(); + Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings pdfViewerPrinterSettings2 = new Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPridatVyrobok)); - Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings textSearchSettings1 = new Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings(); + Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings textSearchSettings2 = new Syncfusion.Windows.Forms.PdfViewer.TextSearchSettings(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.textBox7 = new System.Windows.Forms.TextBox(); @@ -105,7 +105,7 @@ this.groupBox3.Controls.Add(this.label3); this.groupBox3.Location = new System.Drawing.Point(236, 7); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(247, 148); + this.groupBox3.Size = new System.Drawing.Size(251, 148); this.groupBox3.TabIndex = 3; this.groupBox3.TabStop = false; this.groupBox3.Text = "Tvar a rozmery výrobku"; @@ -113,7 +113,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(120, 121); + this.label1.Location = new System.Drawing.Point(125, 123); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(93, 13); this.label1.TabIndex = 15; @@ -121,7 +121,7 @@ // // textBox7 // - this.textBox7.Location = new System.Drawing.Point(216, 118); + this.textBox7.Location = new System.Drawing.Point(221, 120); this.textBox7.Name = "textBox7"; this.textBox7.Size = new System.Drawing.Size(25, 20); this.textBox7.TabIndex = 16; @@ -141,7 +141,7 @@ // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(7, 121); + this.label8.Location = new System.Drawing.Point(7, 123); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(32, 13); this.label8.TabIndex = 2; @@ -159,7 +159,7 @@ // // textBox5 // - this.textBox5.Location = new System.Drawing.Point(38, 118); + this.textBox5.Location = new System.Drawing.Point(40, 120); this.textBox5.Name = "textBox5"; this.textBox5.Size = new System.Drawing.Size(83, 20); this.textBox5.TabIndex = 3; @@ -188,7 +188,7 @@ // this.textBox1.Location = new System.Drawing.Point(7, 94); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(234, 20); + this.textBox1.Size = new System.Drawing.Size(238, 20); this.textBox1.TabIndex = 10; this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // @@ -282,7 +282,7 @@ this.dataGridView1.ShowCellToolTips = false; this.dataGridView1.ShowEditingIcon = false; this.dataGridView1.ShowRowErrors = false; - this.dataGridView1.Size = new System.Drawing.Size(347, 106); + this.dataGridView1.Size = new System.Drawing.Size(599, 106); this.dataGridView1.TabIndex = 4; this.dataGridView1.DataMemberChanged += new System.EventHandler(this.dataGridView1_DataMemberChanged); this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); @@ -292,7 +292,7 @@ // btnAddVykres // this.btnAddVykres.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnAddVykres.Location = new System.Drawing.Point(173, 121); + this.btnAddVykres.Location = new System.Drawing.Point(425, 121); this.btnAddVykres.Name = "btnAddVykres"; this.btnAddVykres.Size = new System.Drawing.Size(56, 23); this.btnAddVykres.TabIndex = 5; @@ -308,7 +308,7 @@ this.groupBox1.Controls.Add(this.panel1); this.groupBox1.Location = new System.Drawing.Point(2, 151); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(919, 421); + this.groupBox1.Size = new System.Drawing.Size(1180, 421); this.groupBox1.TabIndex = 7; this.groupBox1.TabStop = false; this.groupBox1.Text = "Zobraziť výkres"; @@ -324,7 +324,7 @@ this.panel1.Controls.Add(this.pictureBox1); this.panel1.Location = new System.Drawing.Point(4, 17); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(909, 398); + this.panel1.Size = new System.Drawing.Size(1170, 398); this.panel1.TabIndex = 9; // // pdfDocumentView1 @@ -337,16 +337,16 @@ this.pdfDocumentView1.IsTextSearchEnabled = true; this.pdfDocumentView1.IsTextSelectionEnabled = true; this.pdfDocumentView1.Location = new System.Drawing.Point(36, 3); - messageBoxSettings1.EnableNotification = true; - this.pdfDocumentView1.MessageBoxSettings = messageBoxSettings1; + messageBoxSettings2.EnableNotification = true; + this.pdfDocumentView1.MessageBoxSettings = messageBoxSettings2; this.pdfDocumentView1.MinimumZoomPercentage = 50; this.pdfDocumentView1.Name = "pdfDocumentView1"; this.pdfDocumentView1.PageBorderThickness = 1; - pdfViewerPrinterSettings1.PageOrientation = Syncfusion.Windows.PdfViewer.PdfViewerPrintOrientation.Auto; - pdfViewerPrinterSettings1.PageSize = Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.ActualSize; - pdfViewerPrinterSettings1.PrintLocation = ((System.Drawing.PointF)(resources.GetObject("pdfViewerPrinterSettings1.PrintLocation"))); - pdfViewerPrinterSettings1.ShowPrintStatusDialog = true; - this.pdfDocumentView1.PrinterSettings = pdfViewerPrinterSettings1; + pdfViewerPrinterSettings2.PageOrientation = Syncfusion.Windows.PdfViewer.PdfViewerPrintOrientation.Auto; + pdfViewerPrinterSettings2.PageSize = Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.ActualSize; + pdfViewerPrinterSettings2.PrintLocation = ((System.Drawing.PointF)(resources.GetObject("pdfViewerPrinterSettings2.PrintLocation"))); + pdfViewerPrinterSettings2.ShowPrintStatusDialog = true; + this.pdfDocumentView1.PrinterSettings = pdfViewerPrinterSettings2; this.pdfDocumentView1.ReferencePath = null; this.pdfDocumentView1.ScrollDisplacementValue = 0; this.pdfDocumentView1.ShowHorizontalScrollBar = true; @@ -354,10 +354,10 @@ this.pdfDocumentView1.Size = new System.Drawing.Size(150, 150); this.pdfDocumentView1.SpaceBetweenPages = 8; this.pdfDocumentView1.TabIndex = 10; - textSearchSettings1.CurrentInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(171)))), ((int)(((byte)(64))))); - textSearchSettings1.HighlightAllInstance = true; - textSearchSettings1.OtherInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(254)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))); - this.pdfDocumentView1.TextSearchSettings = textSearchSettings1; + textSearchSettings2.CurrentInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(255)))), ((int)(((byte)(171)))), ((int)(((byte)(64))))); + textSearchSettings2.HighlightAllInstance = true; + textSearchSettings2.OtherInstanceColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(254)))), ((int)(((byte)(255)))), ((int)(((byte)(0))))); + this.pdfDocumentView1.TextSearchSettings = textSearchSettings2; this.pdfDocumentView1.ThemeName = "Default"; this.pdfDocumentView1.VerticalScrollOffset = 0; this.pdfDocumentView1.VisualStyle = Syncfusion.Windows.Forms.PdfViewer.VisualStyle.Default; @@ -387,7 +387,7 @@ // this.btnVymazVykres.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnVymazVykres.Enabled = false; - this.btnVymazVykres.Location = new System.Drawing.Point(287, 121); + this.btnVymazVykres.Location = new System.Drawing.Point(539, 121); this.btnVymazVykres.Name = "btnVymazVykres"; this.btnVymazVykres.Size = new System.Drawing.Size(61, 23); this.btnVymazVykres.TabIndex = 8; @@ -423,9 +423,9 @@ this.groupBox4.Controls.Add(this.btnAddVykres); this.groupBox4.Controls.Add(this.button4); this.groupBox4.Controls.Add(this.btnVymazVykres); - this.groupBox4.Location = new System.Drawing.Point(485, 7); + this.groupBox4.Location = new System.Drawing.Point(489, 7); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(351, 148); + this.groupBox4.Size = new System.Drawing.Size(603, 148); this.groupBox4.TabIndex = 11; this.groupBox4.TabStop = false; this.groupBox4.Text = "Načítané výkresy"; @@ -434,7 +434,7 @@ // this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.button4.Enabled = false; - this.button4.Location = new System.Drawing.Point(230, 121); + this.button4.Location = new System.Drawing.Point(482, 121); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(56, 23); this.button4.TabIndex = 14; @@ -479,7 +479,7 @@ // // textBox6 // - this.textBox6.Location = new System.Drawing.Point(85, 18); + this.textBox6.Location = new System.Drawing.Point(82, 17); this.textBox6.Name = "textBox6"; this.textBox6.Size = new System.Drawing.Size(118, 20); this.textBox6.TabIndex = 6; @@ -489,7 +489,7 @@ // comboBox2 // this.comboBox2.FormattingEnabled = true; - this.comboBox2.Location = new System.Drawing.Point(85, 44); + this.comboBox2.Location = new System.Drawing.Point(82, 42); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(118, 21); this.comboBox2.TabIndex = 5; @@ -497,7 +497,7 @@ // label9 // this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(15, 47); + this.label9.Location = new System.Drawing.Point(15, 46); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(53, 13); this.label9.TabIndex = 4; @@ -507,7 +507,7 @@ // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(5, 21); + this.label7.Location = new System.Drawing.Point(2, 20); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(79, 13); this.label7.TabIndex = 0; @@ -516,7 +516,7 @@ // button3 // this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.button3.Location = new System.Drawing.Point(837, 128); + this.button3.Location = new System.Drawing.Point(1098, 128); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(84, 23); this.button3.TabIndex = 13; @@ -528,7 +528,7 @@ // this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.button5.Enabled = false; - this.button5.Location = new System.Drawing.Point(837, 99); + this.button5.Location = new System.Drawing.Point(1098, 99); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(84, 23); this.button5.TabIndex = 15; @@ -539,9 +539,9 @@ // button6 // this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.button6.Location = new System.Drawing.Point(117, 130); + this.button6.Location = new System.Drawing.Point(117, 125); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(51, 19); + this.button6.Size = new System.Drawing.Size(51, 24); this.button6.TabIndex = 16; this.button6.Text = "Zoom +"; this.button6.UseVisualStyleBackColor = true; @@ -550,9 +550,9 @@ // button7 // this.button7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.button7.Location = new System.Drawing.Point(174, 130); + this.button7.Location = new System.Drawing.Point(174, 125); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(51, 19); + this.button7.Size = new System.Drawing.Size(51, 24); this.button7.TabIndex = 17; this.button7.Text = "Zoom -"; this.button7.UseVisualStyleBackColor = true; @@ -563,7 +563,7 @@ this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.radioButton1.AutoSize = true; this.radioButton1.Checked = true; - this.radioButton1.Location = new System.Drawing.Point(837, 12); + this.radioButton1.Location = new System.Drawing.Point(1096, 12); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(71, 17); this.radioButton1.TabIndex = 18; @@ -575,7 +575,7 @@ // this.radioButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.radioButton2.AutoSize = true; - this.radioButton2.Location = new System.Drawing.Point(837, 35); + this.radioButton2.Location = new System.Drawing.Point(1096, 35); this.radioButton2.Name = "radioButton2"; this.radioButton2.Size = new System.Drawing.Size(90, 17); this.radioButton2.TabIndex = 19; @@ -586,7 +586,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(923, 574); + this.ClientSize = new System.Drawing.Size(1184, 574); this.Controls.Add(this.radioButton2); this.Controls.Add(this.radioButton1); this.Controls.Add(this.groupBox3); diff --git a/Mip/frmPridatVyrobok.cs b/Mip/frmPridatVyrobok.cs index e4359a2..f03f3b5 100644 --- a/Mip/frmPridatVyrobok.cs +++ b/Mip/frmPridatVyrobok.cs @@ -8,6 +8,9 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; +using Syncfusion.Pdf.Parsing; +using System.Drawing.Imaging; + namespace Mip { @@ -53,6 +56,8 @@ namespace Mip pomocnaDT.Columns.Add("Velkost_suboru",typeof (string)); pomocnaDT.Columns.Add("Typ_suboru", typeof(string)); pomocnaDT.Columns.Add("Cesta",typeof (string)); + pomocnaDT.Columns.Add("Data", typeof(string)); + pomocnaDT.Columns.Add("Valid", typeof(int)); VypisSpojenyRozmer(); classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať iný názov"); @@ -60,16 +65,13 @@ namespace Mip private void btnAddVykres_Click(object sender, EventArgs e) { - - openFileDialog1.Multiselect = true; openFileDialog1.DefaultExt = "jpg"; - openFileDialog1.Filter = "Obrázky (*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF)|*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF|" + - "Pdf súbory (*.pdf)|*.pdf"; + openFileDialog1.Filter = "Obrázky (*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF)|*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF|" + "Pdf súbory (*.pdf)|*.pdf"; openFileDialog1.FilterIndex = 1; - openFileDialog1.FileName = ""; openFileDialog1.ShowDialog(); + if (openFileDialog1.FileNames != null && openFileDialog1.FileName != "") { foreach (string Cesta in openFileDialog1.FileNames) @@ -84,45 +86,72 @@ namespace Mip { FileStream fileStream; fileStream = new FileStream(Cesta, FileMode.Open, FileAccess.Read); - //char[] help = new char[Cesta.Length - Cesta.LastIndexOf("\\") - 1]; + var fileSize = (int)fileStream.Length; + var VykresData = new byte[fileSize]; + fileStream.Read(VykresData, 0, fileSize); - - //Cesta.CopyTo(Cesta.LastIndexOf("\\") + 1, help, 0, (help.Length)); - //string hlp = new string(help); var FileNameStart = Cesta.LastIndexOf("\\") + 1; var FileName = Cesta.Substring(FileNameStart, Cesta.Length - FileNameStart); var ExtensionStart = Cesta.LastIndexOf(".") + 1; var Extension = Cesta.Substring(ExtensionStart, Cesta.Length - ExtensionStart); - pomocnaDT.Rows.Add(FileName, Cesta.Length.ToString(), Extension, Cesta); + pomocnaDT.Rows.Add(FileName, Cesta.Length.ToString(), Extension, Cesta, VykresData.ToString(), Convert.ToInt32(IsFileValid(VykresData, Extension))); dataGridView1.DataSource = pomocnaDT; - dataGridView1.AutoResizeColumns(); - dataGridView1.AutoResizeRows(); + StyleGridView(); dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true; obrazok_Refresh(dataGridView1.Rows.Count - 1); - if (dataGridView1.Rows.Count > 4) dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 4; + if (dataGridView1.Rows.Count > 5) dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 5; } else { MessageBox.Show("Súbor: " + Cesta + "\n už v zozname figuruje!", "Upozornenie ...", MessageBoxButtons.OK, MessageBoxIcon.Warning); - //MessageBox.Show( - } - pictureBox1.Visible = true; - } - - - } if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true; else button5.Enabled = false; //kontrola naplnenia povinných dát } + private void StyleGridView() + { + dataGridView1.Columns["Data"].Visible = false; + + dataGridView1.AutoResizeColumns(); + dataGridView1.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + dataGridView1.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + dataGridView1.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + dataGridView1.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dataGridView1.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + dataGridView1.AutoResizeRows(); + } + + private bool IsFileValid(byte[] vykresData, string extension) + { + try + { + switch (extension) + { + case "pdf": + PdfLoadedDocument loadedDocument = new PdfLoadedDocument(vykresData); + Bitmap pdfToJpeg = loadedDocument.ExportAsImage(0); + loadedDocument.Close(true); + return true; + default: + var memoryStream = new MemoryStream(vykresData); + Bitmap image = new Bitmap(memoryStream); + return true; + } + } + catch (Exception) + { + //MessageBox.Show($"Súbor '{Cesta}' nie je obrázok ani pdf"); + return false; + } + } private void btnVymazVykres_Click(object sender, EventArgs e) { @@ -181,33 +210,42 @@ namespace Mip dRow = pomocnaDT.Rows[index]; var isPdf = dRow["Typ_suboru"].ToString() == "pdf"; + var isValid = dRow["Valid"].ToString() == "1"; - if (isPdf) + if(isValid) { - FileStream pdfFileStream = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read); - pictureBox1.Visible = false; - pdfDocumentView1.Visible = true; - pdfDocumentView1.Load(pdfFileStream); - pdfDocumentView1.ZoomMode = Syncfusion.Windows.Forms.PdfViewer.ZoomMode.FitWidth; - pdfDocumentView1.Dock = DockStyle.Fill; + if (isPdf) + { + FileStream pdfFileStream = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read); + pictureBox1.Visible = false; + pdfDocumentView1.Visible = true; + pdfDocumentView1.Load(pdfFileStream); + pdfDocumentView1.ZoomMode = Syncfusion.Windows.Forms.PdfViewer.ZoomMode.FitWidth; + pdfDocumentView1.Dock = DockStyle.Fill; + } + else + { + fs = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read); + fileSize = (int)fs.Length; + fileData = new byte[fileSize]; + fs.Read(fileData, 0, fileSize); + fs.Close(); + Bitmap obrazok; + //using (MemoryStream stream = new MemoryStream(fileData)) obrazok = new Bitmap(stream); + MemoryStream stream = new MemoryStream(fileData); + obrazok = new Bitmap(stream); + pictureBox1.Visible = true; + pictureBox1.Image = obrazok; + pictureBox1.Height = obrazok.Height; + pictureBox1.Width = obrazok.Width; + sizeH = pictureBox1.Image.Size.Height; + sizeW = pictureBox1.Image.Size.Width; + pdfDocumentView1.Visible = false; + } } else { - fs = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read); - fileSize = (int)fs.Length; - fileData = new byte[fileSize]; - fs.Read(fileData, 0, fileSize); - fs.Close(); - Bitmap obrazok; - //using (MemoryStream stream = new MemoryStream(fileData)) obrazok = new Bitmap(stream); - MemoryStream stream = new MemoryStream(fileData); - obrazok = new Bitmap(stream); - pictureBox1.Visible = true; - pictureBox1.Image = obrazok; - pictureBox1.Height = obrazok.Height; - pictureBox1.Width = obrazok.Width; - sizeH = pictureBox1.Image.Size.Height; - sizeW = pictureBox1.Image.Size.Width; + pictureBox1.Visible = false; pdfDocumentView1.Visible = false; } @@ -501,13 +539,44 @@ namespace Mip byte[] VykresData; dtrw=pomocnaDT.Rows[p1]; - fs = new FileStream(dtrw["Cesta"].ToString(), FileMode.Open, FileAccess.Read); - fileSize = (int)fs.Length; - VykresData = new byte[fileSize]; - fs.Read(VykresData, 0, fileSize); - fs.Close(); + var isValid = dtrw["Valid"].ToString() == "1"; - classSQL.SaveVykresToSQL(IDVyrobok, p1 + 1, VykresData); + if(isValid) + { + fs = new FileStream(dtrw["Cesta"].ToString(), FileMode.Open, FileAccess.Read); + fileSize = (int)fs.Length; + VykresData = new byte[fileSize]; + fs.Read(VykresData, 0, fileSize); + + var fileToSave = new byte[fileSize]; + + switch (dtrw["Typ_suboru"].ToString()) + { + case "pdf": + PdfLoadedDocument loadedDocument = new PdfLoadedDocument(VykresData); + Bitmap pdfToJpeg = loadedDocument.ExportAsImage(0); + loadedDocument.Close(true); + + fileToSave = SaveAsJpeg(pdfToJpeg); + break; + + case "jpg": + fileToSave = VykresData; + break; + + default: + Bitmap imageToJpeg = new Bitmap(fs); + fileToSave = SaveAsJpeg(imageToJpeg); + break; + } + + fs.Close(); + classSQL.SaveVykresToSQL(IDVyrobok, p1 + 1, fileToSave); + } + else + { + MessageBox.Show($"Výkres '{dtrw["Cesta"]}' nie je validný obrázok alebo pdf! {Environment.NewLine} Preto nebol uložený do databázy."); + } } MessageBox.Show("Výrobok úspešne pridaný!"); @@ -520,6 +589,17 @@ namespace Mip } + private byte[] SaveAsJpeg(Bitmap image) + { + byte[] returnImageData; + using (var stream = new MemoryStream()) + { + image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg); + returnImageData = stream.ToArray(); + } + + return returnImageData; + } private void textBox6_TextChanged(object sender, EventArgs e) { diff --git a/Mip/frmPridatVyrobok.resx b/Mip/frmPridatVyrobok.resx index 5c16971..df9c36e 100644 --- a/Mip/frmPridatVyrobok.resx +++ b/Mip/frmPridatVyrobok.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0 dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJh diff --git a/Mip/obj/Debug/Mip.Properties.Resources.resources b/Mip/obj/Debug/Mip.Properties.Resources.resources index 8fd6c05f59fed93b3543c8049ec5092c8706a650..1017756ea1654a6bd476c7ab8c7de443989b5d38 100644 GIT binary patch delta 525 zcmaKnO=uHQ5Xb*{?#@0!jiscY2H8TQhY$jd^q6{(=2YlKL!J|%);z5wdykTa3^PibcE8J;?_pWI5 zqaq=YMh17-R@r8-yH1d4+{GFS_*y3nXJF$7N?bLOz(wpg2>wCRX39otlQk^d;-G*f zR!HMVlMu3y=eFD27Gt007sD~uZxezRf`5tQ%FkW*yB0ZBd&FByLNwqgZ zTTu-`KqZrOepXx+-un)Xd2_$?nD^PDh-%-XmJnx8s%VY6x?0(xYm;J8A7D9^SM(|* z7HqdS8B&)&(vdB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CJvuF!^s$v%rc=|G#bo?X*x#|#wID&mh|*2eWpo@v?I0p-ib3k9umD~+i1JCCjR89 zU3v1%+P_|*emvxSRx_{d**$O_?ab7Wj`3MH{;nmB--Mh>` zjSQ`RINaT{df@k-zO}y(cc1^rdHL+>Pi4=M+jKwL?&*5g@xkglvS;Kr)i%ZR-1+|k D{h$c+ diff --git a/Mip/obj/Debug/Mip.csproj.ResolveComReference.cache b/Mip/obj/Debug/Mip.csproj.ResolveComReference.cache index 2f029d92cffd848ed0cde8bed1e6c3534fb4895d..4b9db259717f62258b509dbdcae8f19f3387db60 100644 GIT binary patch delta 29 lcmZ3*wu)^-Jrg?%0|NsW7yINkrrDhQ{+ir+Yp!*00|00K2TT9} delta 29 lcmZ3*wu)^-Jrg?<0|NsW7xUycrrDfk^()p|Upn2v4FGa<2<89) diff --git a/Mip/obj/Debug/Mip.frmPridatVyrobok.resources b/Mip/obj/Debug/Mip.frmPridatVyrobok.resources index c35c614176c0666d11a9fa3903e92aedebd01caa..89f860da118611e3a505a9e844d94601e7586327 100644 GIT binary patch delta 22 ecmbQjGKFP>1S88lK^vdRGK`jtMw7!B_W=MzHU;?r delta 22 ecmbQjGKFP>1S3oASxJ`3GK`jthLgh>_W=M!a|Q?i