Colmeister
2009-05-06 09:56:01 UTC
Hi,
I'm writing an app using Managed DirectX in C# and have an image in the form
of an array of Color structs that I need to convert to a Texture in order to
draw using the Sprite class. What is the quickest way of doing this?
The most obvious way is creating a Bitmap and then using Texture.FromBitmap
but I don't know if this is the fastest. There are also many ways to create
the Bitmap, I've found to my surprise that the Bitmap's SetPixel method is
actually quicker than creating a Graphics object from the Bitmap and using
DrawLine/DrawRect.
Thanks in advance,
Colin
I'm writing an app using Managed DirectX in C# and have an image in the form
of an array of Color structs that I need to convert to a Texture in order to
draw using the Sprite class. What is the quickest way of doing this?
The most obvious way is creating a Bitmap and then using Texture.FromBitmap
but I don't know if this is the fastest. There are also many ways to create
the Bitmap, I've found to my surprise that the Bitmap's SetPixel method is
actually quicker than creating a Graphics object from the Bitmap and using
DrawLine/DrawRect.
Thanks in advance,
Colin