Can anyone get the DirectX 3D TextureLoader.FromFile method to work
with a GIF? I used the method with a PNG and BMP, both worked perfect,
however, I need it to work with a GIF.
On MSDN it says, "This method supports the following file formats: .bmp, .dds, .jpg, .png, and .gif. "
http://msdn.microsoft.com/en-us/library/ms130475.aspx
I posted on experts-exchange and did not find the answer.. Please, anyone have working code?
| private Device device; |
| private Texture texture; |
| |
| public Form1() |
| { |
| InitializeComponent(); |
| |
| PresentParameters present; |
| present = new PresentParameters(); |
| present.Windowed = true; |
| present.SwapEffect = SwapEffect.Discard; |
| device = new Device(0, DeviceType.Hardware, this.displayBox, |
| CreateFlags.SoftwareVertexProcessing, present); |
| device.DeviceReset += OnDeviceReset; |
| OnDeviceReset(null, EventArgs.Empty); |
| } |
| |
| |
| private void OnDeviceReset(object sender, EventArgs e) |
| { |
| try |
| { |
| texture = TextureLoader.FromFile(device, Directory.GetCurrentDirectory() + "\\graphics\\tileset.gif", 0, 0, 1, Usage.None, Format.Unknown, Pool.Managed, Filter.None, Filter.None, Color.Magenta.ToArgb()); |
| } |
| catch(Exception ex){ |
| MessageBox.Show(ex.Message.ToString()); |
| } |
| } |