Browse Source

try merge

TiReischl 5 years ago
parent
commit
fde41312f7

+ 13 - 0
Finished Userstories/userstory3.md

@@ -0,0 +1,13 @@
+# Userstory 3  
+
+|**ID**|3|
+|-|-|
+|**Name**|Neue Zeichenleinwand|  
+|**Beschreibung**|Man kann ein Knopf in der Toolbar drücken, welcher im rechten Bereich des Hauptfensters eine leere Leinwand anzeigt.|
+|**Akzeptanzkriterium**|Wenn der entsprechende Knopf in der Toolbar gedrückt wird, wird der rechte Bereich des Hauptfensters mit einer neuen Zeichenleinwand gefüllt, welche komplett weiß ist. Die größe des Bereiches wird nicht angepasst und die Fenstergröße bleibt unverändert.|
+|Geschätzter Aufwand (Story Points)|6|
+|Entwickler|Martin|
+|Umgesetzt in Iteration|2|
+|Tatsächlicher Aufwand (Std.)|4.5|
+|Velocity (Std./Story Point)|0.75|
+|Bemerkungen|Keine|

+ 15 - 8
SketchAssistant/SketchAssistant/Form1.Designer.cs

@@ -28,7 +28,7 @@ namespace SketchAssistant
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.pictureBoxRight = new System.Windows.Forms.PictureBox();
@@ -37,7 +37,7 @@ namespace SketchAssistant
             this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
-            this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
+            this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
             this.toolStripLoadStatus = new System.Windows.Forms.ToolStripStatusLabel();
             this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
@@ -80,6 +80,7 @@ namespace SketchAssistant
             this.pictureBoxRight.Margin = new System.Windows.Forms.Padding(0);
             this.pictureBoxRight.Name = "pictureBoxRight";
             this.pictureBoxRight.Size = new System.Drawing.Size(344, 434);
+            this.pictureBoxRight.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBoxRight.TabIndex = 6;
             this.pictureBoxRight.TabStop = false;
             this.pictureBoxRight.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBoxRight_MouseDown);
@@ -130,18 +131,22 @@ namespace SketchAssistant
             // toolStrip1
             // 
             this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripLabel1});
+            this.toolStripButton1});
             this.toolStrip1.Location = new System.Drawing.Point(0, 24);
             this.toolStrip1.Name = "toolStrip1";
             this.toolStrip1.Size = new System.Drawing.Size(696, 25);
             this.toolStrip1.TabIndex = 3;
             this.toolStrip1.Text = "toolStrip1";
             // 
-            // toolStripLabel1
+            // toolStripButton1
             // 
-            this.toolStripLabel1.Name = "toolStripLabel1";
-            this.toolStripLabel1.Size = new System.Drawing.Size(69, 22);
-            this.toolStripLabel1.Text = "Placeholder";
+            this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+            this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
+            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+            this.toolStripButton1.Name = "toolStripButton1";
+            this.toolStripButton1.Size = new System.Drawing.Size(76, 22);
+            this.toolStripButton1.Text = "New Canvas";
+            this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
             // 
             // statusStrip1
             // 
@@ -200,7 +205,9 @@ namespace SketchAssistant
             this.Name = "Form1";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "Sketch Assistant";
+            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.Load += new System.EventHandler(this.Form1_Load);
+            this.SizeChanged += new System.EventHandler(this.Form1_Resize);
             this.tableLayoutPanel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBoxRight)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBoxLeft)).EndInit();
@@ -222,7 +229,6 @@ namespace SketchAssistant
         private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem loadToolStripMenuItem;
         private System.Windows.Forms.ToolStrip toolStrip1;
-        private System.Windows.Forms.ToolStripLabel toolStripLabel1;
         private System.Windows.Forms.StatusStrip statusStrip1;
         private System.Windows.Forms.ToolStripStatusLabel toolStripLoadStatus;
         private System.ComponentModel.BackgroundWorker backgroundWorker2;
@@ -232,6 +238,7 @@ namespace SketchAssistant
         private System.Windows.Forms.ToolStripMenuItem edittoolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem painttoolStripMenuItem;
         private System.Windows.Forms.Timer timer2;
+        private System.Windows.Forms.ToolStripButton toolStripButton1;
     }
 }
 

+ 46 - 13
SketchAssistant/SketchAssistant/Form1.cs

@@ -7,7 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
-//using SvgNet;
+
 
 // This is the code for your desktop app.
 // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
@@ -25,12 +25,21 @@ namespace SketchAssistant
         OpenFileDialog openFileDialogLeft = new OpenFileDialog();
         //Image loaded on the left
         Image leftImage = null;
+        //Image on the right
+        Image rightImage = null;
 
         private void Form1_Load(object sender, EventArgs e)
         {
             this.DoubleBuffered = true;
             //Connect the Paint event of the left picture box to the event handler method.
             pictureBoxLeft.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxLeft_Paint);
+            pictureBoxRight.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBoxRight_Paint);
+        }
+
+        //Resize Function connected to the form resize event, will refresh the form when it is resized
+        private void Form1_Resize(object sender, System.EventArgs e)
+        {
+            this.Refresh();
         }
 
         private void pictureBoxLeft_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
@@ -40,13 +49,15 @@ namespace SketchAssistant
             {
                 pictureBoxLeft.Image = leftImage;
             }
-
         }
 
-        //TODO: Remove this placeholder when real buttons are in place
-        private void toolStripLabel1_Click(object sender, EventArgs e)
+        private void pictureBoxRight_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
         {
-
+            //Draw the right image
+            if (rightImage != null)
+            {
+                pictureBoxRight.Image = rightImage;
+            }
         }
 
         // A Table Layout with one row and two columns. 
@@ -71,9 +82,9 @@ namespace SketchAssistant
             {
                 toolStripLoadStatus.Text = openFileDialogLeft.SafeFileName;
                 leftImage = Image.FromFile(openFileDialogLeft.FileName);
-                //The following line is needed, as else on first image load
-                //the image will only be shown after resizing the window.
+                //Refresh the left image box when the content is changed
                 this.Refresh();
+                pictureBoxLeft.Refresh();
             }
         }
 
@@ -86,18 +97,13 @@ namespace SketchAssistant
         {
 
         }
-        
-        //Timer that refreshes the picture box, so that it will always show the right contents in the right size
-        private void timer1_Tick(object sender, EventArgs e)
-        {
-            pictureBoxLeft.Update();
-        }
 
         private void pictureBoxLeft_Click(object sender, EventArgs e)
         {
 
         }
 
+<<<<<<< HEAD
         //Beginn userstory4
         Bitmap skizze = null;
         Graphics graph = null;
@@ -176,5 +182,32 @@ namespace SketchAssistant
         }
 
         //Ende userstory4
+=======
+        //Button to create a new Canvas. Will create an empty image 
+        //which is the size of the left image, if there is one.
+        //If there is no image loaded the canvas will be the size of the right picture box
+        private void toolStripButton1_Click(object sender, EventArgs e)
+        {
+            if (leftImage == null)
+            {
+                rightImage = new Bitmap(pictureBoxRight.Width, pictureBoxRight.Height);
+                using (Graphics grp = Graphics.FromImage(rightImage))
+                {
+                    grp.FillRectangle(Brushes.White, 0, 0, pictureBoxRight.Width + 10, pictureBoxRight.Height + 10);
+                }
+            }
+            else
+            {
+                rightImage = new Bitmap(leftImage.Width, leftImage.Height);
+                using (Graphics grp = Graphics.FromImage(rightImage))
+                {
+                    grp.FillRectangle(Brushes.White, 0, 0, leftImage.Width + 10, leftImage.Height + 10);
+                }
+            }
+            this.Refresh();
+            pictureBoxRight.Refresh();
+        }
+        
+>>>>>>> develop
     }
 }

+ 20 - 1
SketchAssistant/SketchAssistant/Form1.resx

@@ -126,19 +126,38 @@
   <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>401, 17</value>
   </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+        YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+        0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+        bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+        VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+        c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+        Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+        mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+        kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+        TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+  </data>
   <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>506, 17</value>
   </metadata>
   <metadata name="backgroundWorker2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>622, 17</value>
   </metadata>
+<<<<<<< HEAD
   <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>786, 17</value>
   </metadata>
   <metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>873, 17</value>
   </metadata>
+=======
+>>>>>>> develop
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>43</value>
+    <value>47</value>
   </metadata>
 </root>