protected override D3D.Texture _GetTexture(D3D.Device device, int index)
        {
            switch (_TextureDefinitions[index].Format)
            {
            case VRMFormat.Uncompressed:
            {
                Stream xStream = GetUncompressedDataAsStream(index);
                return(D3D.Texture.FromBitmap(device, (Bitmap)Bitmap.FromStream(xStream), D3D.Usage.None, D3D.Pool.Managed));
            }

            default:
            {
                Stream xStream = GetDXTCDataAsStream(index);
                D3D.ImageInformation xImageInfo = D3D.TextureLoader.ImageInformationFromStream(xStream);
                xStream.Position = 0;
                return(D3D.TextureLoader.FromStream(
                           device,
                           xStream,
                           xImageInfo.Width,
                           xImageInfo.Height,
                           xImageInfo.MipLevels,
                           D3D.Usage.None,
                           xImageInfo.Format,
                           D3D.Pool.Managed,
                           D3D.Filter.None,
                           D3D.Filter.None,
                           0x00000000
                           ));
            }
            }
        }
예제 #2
0
        private void SyncWallpaper()
        {
            // open the dekstop registry key
            Microsoft.Win32.RegistryKey DesktopKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop");
            // read the last converted wallpaper (in case the new wallpaper is a JPEG converted to wallpaper1.bmp)
            string LastConvertedWallpaperPathNew = (string)DesktopKey.GetValue("ConvertedWallpaper");
            // read the actual wallpaper path
            string WallpaperPathNew = (string)DesktopKey.GetValue("Wallpaper");

            DesktopKey.Close();

            if (WallpaperPathNew == "" || WallpaperPathNew == null)
            {
                return;
            }

            // if the WallpaperPath has changed, then the user set a new BMP
            // if the LastConvertedWallpaper changed, then the user set a new JPEG (BMP name doesn't necessarily change if previous wallpaper was a JPEG too)
            if (WallpaperPathNew != WallpaperPath || LastConvertedWallpaperPathNew != LastConvertedWallpaperPath)
            {
                // load new bg
                SetBg(WallpaperPathNew);
                // update the image information
                Microsoft.DirectX.Direct3D.ImageInformation ImageInformation = Microsoft.DirectX.Direct3D.TextureLoader.ImageInformationFromFile(WallpaperPathNew);
                _BackgroundSize = new Size(ImageInformation.Width, ImageInformation.Height);
                // debug out wallpaper changed
                //System.Diagnostics.Debug.WriteLine("Wallpaper path changed to: "+WallpaperPathNew);
                // update the track strings
                WallpaperPath = WallpaperPathNew;
                LastConvertedWallpaperPath = LastConvertedWallpaperPathNew;
            }
        }
예제 #3
0
 public static CubeTexture FromCubeFile(Device device, string srcFile, int size, int mipLevels, Usage usage, Format format, Pool pool, Filter filter, Filter mipFilter, int colorKey, ref ImageInformation srcInformation, out PaletteEntry[] palette)
 {
     throw new NotImplementedException();
 }
예제 #4
0
 public static Texture FromFile(Device device, string srcFile, int width, int height, int mipLevels, Usage usage, Format format, Pool pool, Filter filter, Filter mipFilter, int colorKey, ref ImageInformation srcInformation)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public static VolumeTexture FromVolumeStream(Device device, Stream stream, int readBytes, int width, int height, int depth, int mipLevels, Usage usage, Format format, Pool pool, Filter filter, Filter mipFilter, int colorKey, ref ImageInformation srcInformation, out PaletteEntry[] palette)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 public static CubeTexture FromCubeStream(Device device, Stream stream, int readBytes, int size, int mipLevels, Usage usage, Format format, Pool pool, Filter filter, Filter mipFilter, int colorKey, ref ImageInformation srcInformation)
 {
     throw new NotImplementedException();
 }