public SpriteTexture(D3D.Device device, string filename)
            : base(device)
        {
            D3D.ImageLoadInformation iml = new D3D.ImageLoadInformation()
            {
                BindFlags = D3D.BindFlags.ShaderResource,
                CpuAccessFlags = D3D.CpuAccessFlags.None,
                Depth = 1,
                FilterFlags = D3D.FilterFlags.None,
                FirstMipLevel = 0,
                Format = SlimDX.DXGI.Format.R8G8B8A8_UNorm,
                MipFilterFlags = D3D.FilterFlags.None,
                MipLevels = 1,
                OptionFlags = D3D.ResourceOptionFlags.None,
                Usage = D3D.ResourceUsage.Default
            };
            Resource = D3D.Texture2D.FromFile(device, filename, iml);
            View = new D3D.ShaderResourceView(device, Resource);
            Instance = new D3D.SpriteInstance(this.View, new Vector2(0, 0), new Vector2(1, 1));

            UpdateTransform();
        }
 protected override void RecreateTexture(int width, int height)
 {
     base.RecreateTexture(width, height);
     if (View != null) View.Dispose();
     View = new D3D.ShaderResourceView(device, Resource);
     Instance = new D3D.SpriteInstance(this.View, new Vector2(0, 0), new Vector2(1, 1));
     //Instance.Color = new Color4(AlphaBlend, 1, 1, 1);
     UpdateTransform();
 }