diff --git a/Board/Board.cs b/Board/Board.cs index 7d5508c..1640561 100644 --- a/Board/Board.cs +++ b/Board/Board.cs @@ -285,7 +285,9 @@ public Board() { // WinForms automatic initialization InitializeComponent(); - + // this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); + this.DoubleBuffered = true; + // Load the sounds _path = System.IO.Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); _soundPlayer = new System.Media.SoundPlayer[Enum.GetNames(typeof(AudioSoundType)).Length]; // https://stackoverflow.com/questions/856154/total-number-of-items-defined-in-an-enum @@ -671,6 +673,7 @@ private System.Drawing.Bitmap GetBitmapFromSVG(string path, int width, int heigh /// Gets a region pixel by pixel from the non-transparent pixels of the bitmap /// More information here: https://www.codeproject.com/Articles/617613/Fast-pixel-operations-in-NET-with-and-without-unsa /// and here: https://www.codeproject.com/Articles/406045/Why-the-use-of-GetPixel-and-SetPixel-is-so-ineffic + /// and here: // https://social.msdn.microsoft.com/Forums/office/en-US/5d8220b8-a7fa-4b49-8567-7a39da8f79b7/vb2010-how-can-i-make-the-picturebox-realy-transparent?forum=vbgeneral /// /// /// diff --git a/Board/Board.csproj b/Board/Board.csproj index f798a50..c1d6519 100644 --- a/Board/Board.csproj +++ b/Board/Board.csproj @@ -58,9 +58,6 @@ Board.cs - - UserControl - diff --git a/Board/clsPictureBoxTransparent.cs b/Board/clsPictureBoxTransparent.cs index 1cbb33c..d69bbec 100644 --- a/Board/clsPictureBoxTransparent.cs +++ b/Board/clsPictureBoxTransparent.cs @@ -45,5 +45,17 @@ protected override void OnBackgroundImageChanged(EventArgs e) } } } + + private void InitializeComponent() + { + this.SuspendLayout(); + // + // PictureBoxTransparent + // + this.DoubleBuffered = true; + this.Name = "PictureBoxTransparent"; + this.ResumeLayout(false); + + } } } diff --git a/Board/clsPictureBoxTransparent.resx b/Board/clsPictureBoxTransparent.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Board/clsPictureBoxTransparent.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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