diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..506f313 --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,80 @@ + +namespace HusaMK._3 +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.BackColor = System.Drawing.Color.Transparent; + this.pictureBox1.InitialImage = global::HusaMK._3.Properties.Resources.smol_brn; + this.pictureBox1.Location = new System.Drawing.Point(12, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(160, 58); + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoValidate = System.Windows.Forms.AutoValidate.Disable; + this.BackColor = System.Drawing.Color.White; + this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.CausesValidation = false; + this.ClientSize = new System.Drawing.Size(960, 497); + this.ControlBox = false; + this.Controls.Add(this.pictureBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.ImeMode = System.Windows.Forms.ImeMode.Off; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Form1"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.TopMost = true; + this.TransparencyKey = System.Drawing.Color.White; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..3ea1317 --- /dev/null +++ b/Form1.cs @@ -0,0 +1,37 @@ +using Microsoft.CodeAnalysis; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HusaMK._3 +{ + public partial class Form1 : Form + { + public volatile PictureBox obrazok; + public Size plocha; + public bool ready = false; + public Form1() + { + InitializeComponent(); + } + + + private void Form1_Load(object sender, EventArgs e) + { + plocha = new Size(Screen.FromControl(this).Bounds.Width, Screen.FromControl(this).Bounds.Height); + this.TabStop = false; + this.AllowTransparency = true; + this.Size = plocha; + pictureBox1.Image = HusaMK._3.Properties.Resources.smol_brn; + this.FormBorderStyle = FormBorderStyle.None; + obrazok = pictureBox1; + this.ready = true; + } + } +} diff --git a/Form1.resx b/Form1.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Form1.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HusaMK.3.csproj b/HusaMK.3.csproj new file mode 100644 index 0000000..476ffa0 --- /dev/null +++ b/HusaMK.3.csproj @@ -0,0 +1,39 @@ + + + + WinExe + net5.0-windows + HusaMK._3 + true + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + + + + + + + Never + + + + \ No newline at end of file diff --git a/HusaMK.3.sln b/HusaMK.3.sln new file mode 100644 index 0000000..83382fb --- /dev/null +++ b/HusaMK.3.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31515.178 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HusaMK.3", "HusaMK.3.csproj", "{5D7EEAC9-C8AF-4BDE-B49B-E3B0EB9811B0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5D7EEAC9-C8AF-4BDE-B49B-E3B0EB9811B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D7EEAC9-C8AF-4BDE-B49B-E3B0EB9811B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D7EEAC9-C8AF-4BDE-B49B-E3B0EB9811B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D7EEAC9-C8AF-4BDE-B49B-E3B0EB9811B0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DE71C24F-509D-4FB0-AE5F-861BD28ECE8C} + EndGlobalSection +EndGlobal diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..dc4427f --- /dev/null +++ b/Program.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace HusaMK._3 +{ + static class Program + { + /// + /// The main entry point for the application. + /// + /// + + public static volatile Form1 form; + + public const int smoothingx = 10; + + static void runform(object data) + { + + Application.Run((Form1) data); + + } + + + static void movechar(object data) + { + Form1 formx = (Form1)data; + int xdif; + int ydif; + int xpos = 0; + int ypos = 0; + int steps = 1; + while (true) + { + xdif = formx.obrazok.Location.X - Cursor.Position.X; + ydif = formx.obrazok.Location.Y - Cursor.Position.Y; + + + if (xdif > 0 && xdif > 5) + { + xpos = formx.obrazok.Location.X - steps; + } + else if (xdif < 0 && xdif < -5) + { + xpos = formx.obrazok.Location.X + steps; + } + if (ydif > 0 && xdif > 5) + { + ypos = formx.obrazok.Location.Y - steps; + } + else if (ydif < 0 && ydif < -5) + { + ypos = formx.obrazok.Location.Y + steps; + } + formx.obrazok.Location = new Point(xpos, ypos); + Thread.Sleep(1); + } + + } + + static void Main() + { + Application.SetHighDpiMode(HighDpiMode.SystemAware); + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Control.CheckForIllegalCrossThreadCalls = false; // daj sa vypchat c# + + form = new Form1(); + Thread thread = new Thread(runform); + Thread movchr = new Thread(movechar); + thread.Start(form); + + + while (!form.ready) { + Thread.Sleep(10); + } + movchr.Start(form); + + } + } +} diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..00af444 --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HusaMK._3.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HusaMK._3.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap smol_brn { + get { + object obj = ResourceManager.GetObject("smol_brn", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..41815c7 --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\smol_brn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/Resources/smol_brn.png b/Resources/smol_brn.png new file mode 100644 index 0000000..7d7199e Binary files /dev/null and b/Resources/smol_brn.png differ