Browse Source

Добавлена 8 лабораторная

Вадим Королёв 2 years ago
parent
commit
3cdf18c519

+ 46 - 0
8 Winforms_Graphics/MainForm.Designer.cs

@@ -0,0 +1,46 @@
+namespace Winforms_Graphics
+{
+    partial class MainForm
+    {
+        /// <summary>
+        ///  Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        ///  Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        ///  Required method for Designer support - do not modify
+        ///  the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            SuspendLayout();
+            // 
+            // MainForm
+            // 
+            AutoScaleDimensions = new SizeF(7F, 15F);
+            AutoScaleMode = AutoScaleMode.Font;
+            ClientSize = new Size(359, 461);
+            Name = "MainForm";
+            Text = "Тестирование графики";
+            Paint += MainForm_Paint;
+            ResumeLayout(false);
+        }
+
+        #endregion
+    }
+}

+ 47 - 0
8 Winforms_Graphics/MainForm.cs

@@ -0,0 +1,47 @@
+namespace Winforms_Graphics
+{
+    public partial class MainForm : Form
+    {
+        public MainForm()
+        {
+            InitializeComponent();
+        }
+
+        /// <summary>
+        /// Îòðèñîâêà ôèãóðû
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MainForm_Paint(object sender, PaintEventArgs e)
+        {
+            Graphics g = e.Graphics;
+
+            SolidBrush green1 = new SolidBrush(Color.FromArgb(57, 178, 75));
+            SolidBrush green2 = new SolidBrush(Color.FromArgb(142, 198, 62));
+            SolidBrush green3 = new SolidBrush(Color.FromArgb(190, 215, 50));
+            SolidBrush green4 = new SolidBrush(Color.FromArgb(213, 224, 34));
+
+            g.FillRectangle(green1, 150, 50, 50, 50);
+
+            g.FillRectangle(green1, 100, 100, 50, 50);
+            g.FillRectangle(green2, 150, 100, 50, 50);
+            g.FillRectangle(green1, 200, 100, 50, 50);
+
+            g.FillRectangle(green1, 50, 150, 50, 50);
+            g.FillRectangle(green2, 100, 150, 50, 50);
+            g.FillRectangle(green3, 150, 150, 50, 50);
+            g.FillRectangle(green2, 200, 150, 50, 50);
+            g.FillRectangle(green1, 250, 150, 50, 50);
+
+            g.FillRectangle(green3, 100, 200, 50, 50);
+            g.FillRectangle(green4, 150, 200, 50, 50);
+            g.FillRectangle(green3, 200, 200, 50, 50);
+
+            g.FillRectangle(green4, 100, 250, 50, 50);
+            g.FillRectangle(green4, 160, 275, 30, 30);
+            g.FillRectangle(green4, 200, 250, 50, 50);
+
+            g.FillRectangle(green4, 200, 325, 25, 25);
+        }
+    }
+}

+ 60 - 0
8 Winforms_Graphics/MainForm.resx

@@ -0,0 +1,60 @@
+<root>
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 17 - 0
8 Winforms_Graphics/Program.cs

@@ -0,0 +1,17 @@
+namespace Winforms_Graphics
+{
+    internal static class Program
+    {
+        /// <summary>
+        ///  The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            // To customize application configuration such as set high DPI settings or default font,
+            // see https://aka.ms/applicationconfiguration.
+            ApplicationConfiguration.Initialize();
+            Application.Run(new MainForm());
+        }
+    }
+}

+ 11 - 0
8 Winforms_Graphics/Winforms_Graphics.csproj

@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>WinExe</OutputType>
+    <TargetFramework>net6.0-windows</TargetFramework>
+    <Nullable>enable</Nullable>
+    <UseWindowsForms>true</UseWindowsForms>
+    <ImplicitUsings>enable</ImplicitUsings>
+  </PropertyGroup>
+
+</Project>

+ 25 - 0
8 Winforms_Graphics/Winforms_Graphics.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.5.33516.290
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Winforms_Graphics", "Winforms_Graphics.csproj", "{27D8A102-D58E-4655-85C5-7EF0765BF2EA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{27D8A102-D58E-4655-85C5-7EF0765BF2EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{27D8A102-D58E-4655-85C5-7EF0765BF2EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{27D8A102-D58E-4655-85C5-7EF0765BF2EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{27D8A102-D58E-4655-85C5-7EF0765BF2EA}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {55B287A9-AED2-437D-8165-60567F78A6BA}
+	EndGlobalSection
+EndGlobal