diff --git a/OpenMetaverse/Imaging/TGALoader.cs b/OpenMetaverse/Imaging/TGALoader.cs index d50176d2..e09affa1 100644 --- a/OpenMetaverse/Imaging/TGALoader.cs +++ b/OpenMetaverse/Imaging/TGALoader.cs @@ -455,11 +455,18 @@ namespace OpenMetaverse.Imaging throw new ArgumentException("Image too large."); System.Drawing.Bitmap b = new System.Drawing.Bitmap( - header.ImageSpec.Width, header.ImageSpec.Height); + header.ImageSpec.Width, + header.ImageSpec.Height, + header.ImageSpec.AlphaBits > 0 + ? System.Drawing.Imaging.PixelFormat.Format32bppArgb + : System.Drawing.Imaging.PixelFormat.Format32bppRgb); - System.Drawing.Imaging.BitmapData bd = b.LockBits(new System.Drawing.Rectangle(0, 0, b.Width, b.Height), + System.Drawing.Imaging.BitmapData bd = b.LockBits(new System.Drawing.Rectangle(0, 0, b.Width, b.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, - System.Drawing.Imaging.PixelFormat.Format32bppPArgb); + header.ImageSpec.AlphaBits > 0 + ? System.Drawing.Imaging.PixelFormat.Format32bppPArgb + : System.Drawing.Imaging.PixelFormat.Format32bppRgb); + switch (header.ImageSpec.PixelDepth) { case 8: diff --git a/Programs/WinGridProxy/FormWinGridProxy.cs b/Programs/WinGridProxy/FormWinGridProxy.cs index 70290c07..e3a7f81a 100644 --- a/Programs/WinGridProxy/FormWinGridProxy.cs +++ b/Programs/WinGridProxy/FormWinGridProxy.cs @@ -118,6 +118,8 @@ namespace WinGridProxy FireEventAppender.Instance.MessageLoggedEvent += new MessageLoggedEventHandler(Instance_MessageLoggedEvent); } + + // Attempt to work around some mono inefficiencies monoRuntime = Type.GetType("Mono.Runtime") != null; // Officially supported way of detecting mono if (monoRuntime)