Game Development Reference
In-Depth Information
{
Bitmap result = null;
if (_device == null)
{
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
_device = new Device(0,
DeviceType.Reference,
ContextHandle,
CreateFlags.SoftwareVertexProcessing,
presentParams);
}
using (Texture texture = TextureLoader.FromFile(_device, fileName))
{
using (GraphicsStream stream
= TextureLoader.SaveToStream(ImageFileFormat.Bmp, texture))
{
result = new Bitmap(stream);
}
}
return result;
}
catch
{
return null;
}
}
public override Bitmap Load(MemoryStream stream)
{
try
{
Bitmap result = null;
if (_device == null)
{
Search Nedrilad ::




Custom Search