我有一个代码在form1构造函数中:
ConvertedBmp = ConvertTo24(newest.FullName);
ConvertTo24函数的作用是:
private static Bitmap ConvertTo24(string inputFileName)
{
sw = Stopwatch.StartNew();
Bitmap bmpIn = (Bitmap)Bitmap.FromFile(inputFileName);
Bitmap converted = new Bitmap(bmpIn.Width, bmpIn.Height, PixelFormat.Format24bppRgb);
using (Graphics g = Graphics.FromImage(converted))
{
g.PageUnit = GraphicsUnit.Pixel;
g.DrawImageUnscaled(bmpIn, 0, 0);
}
sw.Stop();
return converted;
}
问题是如何在这一行中使用ConvertedBmp:
backTexture = TextureLoader.FromFile(D3Ddev, @"D:\test.bmp");
TextureLoader有一些属性,其中两个是:FromFile,它获取设备和字符串;FromStream,它获取设备和流。
我已经有了设备对象,但是如何将ConvertedBmp(位图类型)与TextureLoader一起使用?
TextureLoader
是哪个库的一部分,如果是,那么它属于哪个库? - bubbinator