DirectX texture from C# bitmap

I'm new to DirectX, and I'd appreciate some help

I have a texture that I load from a file with that

donutTexture = TextureLoader.FromFile(device, @"..\..\donut.bmp", 320, 384, 1, 0,Format.A8R8G8B8, Pool.Managed, Filter.Point, Filter.Point, (unchecked((int)0xff000000)));

I want to initialize the texture from a bitmap

Bitmap myBitmap = new Bitmap ("MyFileName.bmp");

(In fact I have another part of a C# program that creates the bitmap I want to render later with DirectX).

How can I do that

 

 



Answer this question

DirectX texture from C# bitmap

  • cgn

    TextureLoader.FromStream
     


  • DirectX texture from C# bitmap