Original Post
I am building one project like GoogleEarth, and create two thread for working, one thread for render and another for update,but the problem is that ,when the update thread building texture from bitmap an exception be throwed : E_OUTOFMEMORY: Ran out of memory (-2147024882) can somebody help me? here is my code: if (texture == null) { using (Bitmap bmp = new Bitmap(256, 256)) using (Graphics g = Graphics.FromImage(bmp)) using (MemoryStream ms = new MemoryStream()) { g.Clear(Color.White); g.DrawRectangle(Pens.Red, 0, 0, 255, 255); g.DrawString(name, GlobalSetting.DebugFont, Brushes.Red, 1, 1); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png); byte[] buffer = ms.ToArray(); texture = Texture.FromMemory(e.Device, buffer); } }