Ejemplo n.º 1
0
        /// <summary>	
        /// Loads a volume from memory.	
        /// </summary>	
        /// <param name="destPaletteRef"><para>Pointer to a  <see cref="SharpDX.Direct3D9.PaletteEntry"/> structure, the destination palette of 256 colors or <c>null</c>.</para></param>	
        /// <param name="destBox"><para>Pointer to a <see cref="SharpDX.Direct3D9.Box"/> structure. Specifies the destination box. Set this parameter to <c>null</c> to specify the entire volume.</para></param>	
        /// <param name="srcMemoryPointer"><para>Pointer to the top-left corner of the source volume in memory.</para></param>	
        /// <param name="srcFormat"><para>Member of the <see cref="SharpDX.Direct3D9.Format"/> enumerated type, the pixel format of the source volume.</para></param>	
        /// <param name="srcRowPitch"><para>Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes.</para></param>	
        /// <param name="srcSlicePitch"><para>Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes.</para></param>	
        /// <param name="srcPaletteRef"><para>Pointer to a <see cref="SharpDX.Direct3D9.PaletteEntry"/> structure, the source palette of 256 colors or <c>null</c>.</para></param>	
        /// <param name="srcBox"><para>Pointer to a <see cref="SharpDX.Direct3D9.Box"/> structure. Specifies the source box. <c>null</c> is not a valid value for this parameter.</para></param>	
        /// <param name="filter"><para>A combination of one or more <see cref="SharpDX.Direct3D9.Filter"/> controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying <see cref="SharpDX.Direct3D9.Filter.Triangle"/> | <see cref="SharpDX.Direct3D9.Filter.Dither"/>.</para></param>	
        /// <param name="colorKey"><para> <see cref="SharpDX.Color4"/> value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.</para></param>	
        /// <returns>If the function succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. If the function fails, the return value can be one of the following values: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>, D3DXERR_INVALIDDATA.</returns>	
        /// <remarks>	
        /// Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If <see cref="SharpDX.Direct3D9.D3DX9.LoadVolumeFromMemory"/> is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call <see cref="SharpDX.Direct3D9.VolumeTexture.AddDirtyBox"/> on the volume texture.	
        /// </remarks>	
        /// <unmanaged>HRESULT D3DXLoadVolumeFromMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcRowPitch,[In] unsigned int SrcSlicePitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey)</unmanaged>	
        public unsafe void LoadFromMemory(SharpDX.Direct3D9.PaletteEntry[] destPaletteRef, Box? destBox, System.IntPtr srcMemoryPointer, SharpDX.Direct3D9.Format srcFormat, int srcRowPitch, int srcSlicePitch, SharpDX.Direct3D9.PaletteEntry[] srcPaletteRef, Box srcBox, SharpDX.Direct3D9.Filter filter, ColorBGRA colorKey)
        {
            Box localDestBox;
            if (destBox.HasValue)
                localDestBox = destBox.Value;

            D3DX9.LoadVolumeFromMemory(
                this, destPaletteRef, new IntPtr(&localDestBox), srcMemoryPointer, srcFormat, srcRowPitch, srcSlicePitch, srcPaletteRef, new IntPtr(&srcBox), filter, colorKey.ToBgra());
        }
Ejemplo n.º 2
0
        protected static D3D9.Box ToD3DBoxExtent(PixelBox lockBox)
        {
            var pbox = new D3D9.Box();

            pbox.Left   = 0;
            pbox.Right  = lockBox.Width;
            pbox.Top    = 0;
            pbox.Bottom = lockBox.Height;
            pbox.Front  = 0;
            pbox.Back   = lockBox.Depth;
            return(pbox);
        }
Ejemplo n.º 3
0
        protected static D3D9.Box ToD3DBox(BasicBox lockBox)
        {
            var pbox = new D3D9.Box();

            pbox.Left   = lockBox.Left;
            pbox.Right  = lockBox.Right;
            pbox.Top    = lockBox.Top;
            pbox.Bottom = lockBox.Bottom;
            pbox.Front  = lockBox.Front;
            pbox.Back   = lockBox.Back;
            return(pbox);
        }
Ejemplo n.º 4
0
        protected static D3D9.Box ToD3DBoxExtent(PixelBox lockBox)
        {
            var pbox = new D3D9.Box
            {
                Left   = 0,
                Right  = lockBox.Width,
                Top    = 0,
                Bottom = lockBox.Height,
                Front  = 0,
                Back   = lockBox.Depth
            };

            return(pbox);
        }
Ejemplo n.º 5
0
        protected static D3D9.Box ToD3DBox(BasicBox lockBox)
        {
            var pbox = new D3D9.Box
            {
                Left   = lockBox.Left,
                Right  = lockBox.Right,
                Top    = lockBox.Top,
                Bottom = lockBox.Bottom,
                Front  = lockBox.Front,
                Back   = lockBox.Back
            };

            return(pbox);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Loads a volume from a source volume.
 /// </summary>
 /// <param name="destinationVolume">The destination volume.</param>
 /// <param name="sourceVolume">The source volume.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey)</unmanaged>
 public static void FromVolume(Volume destinationVolume, Volume sourceVolume, Filter filter, int colorKey, Box sourceBox, Box destinationBox)
 {
     FromVolume(destinationVolume, sourceVolume, filter, colorKey, sourceBox, destinationBox, null, null);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Loads a volume from a file in a strean.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <param name="palette">The palette.</param>
 /// <param name="imageInformation">The image information.</param>
 /// <returns>A <see cref="SharpDX.Result" /> object describing the result of the operation.</returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
 public static void FromFileInStream(Volume volume, Stream stream, Filter filter, int colorKey, Box sourceBox, Box destinationBox, PaletteEntry[] palette, out ImageInformation imageInformation)
 {
     unsafe
     {
         fixed (void* pImageInformation = &imageInformation)
             CreateFromFileInStream(volume, stream, filter, colorKey, new IntPtr(&sourceBox), new IntPtr(&destinationBox), palette, (IntPtr)pImageInformation);
     }
 }
Ejemplo n.º 8
0
		protected static D3D9.Box ToD3DBox( BasicBox lockBox )
		{
			var pbox = new D3D9.Box();
			pbox.Left = lockBox.Left;
			pbox.Right = lockBox.Right;
			pbox.Top = lockBox.Top;
			pbox.Bottom = lockBox.Bottom;
			pbox.Front = lockBox.Front;
			pbox.Back = lockBox.Back;
			return pbox;
		}
Ejemplo n.º 9
0
 /// <summary>
 /// Saves a volume to a <see cref="DataStream"/>. 
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="format">The format.</param>
 /// <param name="box">The box.</param>
 /// <param name="palette">The palette.</param>
 /// <returns>A <see cref="SharpDX.Result" /> object describing the result of the operation.</returns>
 /// <unmanaged>HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox)</unmanaged>
 public static DataStream ToStream(Volume volume, ImageFileFormat format, Box box, PaletteEntry[] palette)
 {
     unsafe
     {
         Blob blob;
         D3DX9.SaveVolumeToFileInMemory(out blob, format, volume, palette, new IntPtr(&box));
         return new DataStream(blob);
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Saves a volume to a file on disk.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="format">The format.</param>
 /// <param name="box">The box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox)</unmanaged>
 public static void ToFile(Volume volume, string fileName, ImageFileFormat format, Box box)
 {
     ToFile(volume, fileName, format, box, null);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Loads a volume from a file on the disk.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <param name="palette">The palette.</param>
 /// <param name="imageInformation">The image information.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo)</unmanaged>
 public static void FromFile(Volume volume, string fileName, Filter filter, int colorKey, Box sourceBox, Box destinationBox, PaletteEntry[] palette, out ImageInformation imageInformation)
 {
     unsafe
     {
         fixed (void* pImageInformation = &imageInformation)
             D3DX9.LoadVolumeFromFileW(volume, palette, new IntPtr(&destinationBox), fileName, new IntPtr(&sourceBox), filter, colorKey, (IntPtr)pImageInformation);
     }
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Loads a volume from a file on the disk.
        /// </summary>
        /// <param name="volume">The volume.</param>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="filter">The filter.</param>
        /// <param name="colorKey">The color key.</param>
        /// <param name="sourceBox">The source box.</param>
        /// <param name="destinationBox">The destination box.</param>
        /// <param name="imageInformation">The image information.</param>
        /// <returns>
        /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
        /// </returns>
        /// <unmanaged>HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo)</unmanaged>
        public static void FromFile(Volume volume, string fileName, Filter filter, int colorKey, Box sourceBox, Box destinationBox, out ImageInformation imageInformation)
        {

            FromFile(volume, fileName, filter, colorKey, sourceBox, destinationBox, null, out imageInformation);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Adds a dirty region to a texture resource.
 /// </summary>
 /// <param name="directBoxRef">The direct box ref.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox)</unmanaged>	
 public void AddDirtyBox(Box directBoxRef)
 {
     unsafe
     {
         AddDirtyBox(new IntPtr(&directBoxRef));
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Locks a box on a volume texture resource.
 /// </summary>
 /// <param name="level">The level.</param>
 /// <param name="box">The box.</param>
 /// <param name="flags">The flags.</param>
 /// <returns>
 /// A <see cref="DataRectangle"/> describing the region locked.
 /// </returns>
 /// <unmanaged>HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags)</unmanaged>
 public DataBox LockBox(int level, Box box, SharpDX.Direct3D9.LockFlags flags)
 {
     unsafe
     {
         LockedBox lockedRect;
         LockBox(level, out lockedRect, new IntPtr(&box), flags);
         return new DataBox(lockedRect.PBits, lockedRect.RowPitch, lockedRect.SlicePitch);
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Loads a volume from a source volume.
 /// </summary>
 /// <param name="destinationVolume">The destination volume.</param>
 /// <param name="sourceVolume">The source volume.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <param name="destinationPalette">The destination palette.</param>
 /// <param name="sourcePalette">The source palette.</param>
 /// <returns>A <see cref="SharpDX.Result" /> object describing the result of the operation.</returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey)</unmanaged>
 public static void FromVolume(Volume destinationVolume, Volume sourceVolume, Filter filter, int colorKey, Box sourceBox, Box destinationBox, PaletteEntry[] destinationPalette, PaletteEntry[] sourcePalette)
 {
     unsafe
     {
         D3DX9.LoadVolumeFromVolume(destinationVolume, destinationPalette, new IntPtr(&destinationBox), sourceVolume, sourcePalette, new IntPtr(&sourceBox), filter, colorKey);
     }
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Locks a box on a volume resource.
 /// </summary>
 /// <param name="box">The box.</param>
 /// <param name="flags">The flags.</param>
 /// <returns>The locked region of this resource</returns>
 /// <unmanaged>HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags)</unmanaged>
 public DataBox LockBox(Box box, LockFlags flags)
 {
     unsafe
     {
         LockedBox lockedBox;
         LockBox(out lockedBox, new IntPtr(&box), flags);
         return new DataBox(lockedBox.PBits, lockedBox.RowPitch, lockedBox.SlicePitch);
     }
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Loads a volume from a file in memory.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="memory">The memory.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
 public static void FromFileInMemory(Volume volume, byte[] memory, Filter filter, int colorKey, Box sourceBox, Box destinationBox)
 {
     unsafe
     {
         fixed (void* pMemory = memory)
             D3DX9.LoadVolumeFromFileInMemory(volume, null, new IntPtr(&destinationBox), (IntPtr)pMemory, memory.Length, new IntPtr(&sourceBox), filter, colorKey, IntPtr.Zero);
     }
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Saves a volume to a file on disk.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="format">The format.</param>
 /// <param name="box">The box.</param>
 /// <param name="palette">The palette.</param>
 /// <returns>A <see cref="SharpDX.Result" /> object describing the result of the operation.</returns>
 /// <unmanaged>HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox)</unmanaged>
 public static void ToFile(Volume volume, string fileName, ImageFileFormat format, Box box, PaletteEntry[] palette)
 {
     unsafe
     {
         D3DX9.SaveVolumeToFileW(fileName, format, volume, palette, new IntPtr(&box));
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Loads a volume from a file in memory.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="memory">The memory.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <param name="imageInformation">The image information.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
 public static void FromFileInMemory(Volume volume, byte[] memory, Filter filter, int colorKey, Box sourceBox, Box destinationBox, out ImageInformation imageInformation)
 {
     FromFileInMemory(volume, memory, filter, colorKey, sourceBox, destinationBox, null, out imageInformation);
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Saves a volume to a <see cref="DataStream"/>.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="format">The format.</param>
 /// <param name="box">The box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox)</unmanaged>
 public static DataStream ToStream(Volume volume, ImageFileFormat format, Box box)
 {
     return ToStream(volume, format, box, null);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Loads a volume from a file in memory.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="memory">The memory.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <param name="palette">The palette.</param>
 /// <param name="imageInformation">The image information.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
 public static void FromFileInMemory(Volume volume, byte[] memory, Filter filter, int colorKey, Box sourceBox, Box destinationBox, PaletteEntry[] palette, out ImageInformation imageInformation)
 {
     unsafe
     {
         fixed (void* pMemory = memory)
             fixed (void* pImageInformation = &imageInformation)
                 D3DX9.LoadVolumeFromFileInMemory(volume, palette, new IntPtr(&destinationBox), (IntPtr)pMemory, memory.Length, new IntPtr(&sourceBox), filter, colorKey, (IntPtr)pImageInformation);
     }
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Loads a volume from a file on the disk.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="fileName">Name of the file.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo)</unmanaged>
 public static void FromFile(Volume volume, string fileName, Filter filter, int colorKey, Box sourceBox, Box destinationBox)
 {
     unsafe
     {
         D3DX9.LoadVolumeFromFileW(volume, null, new IntPtr(&destinationBox), fileName, new IntPtr(&sourceBox), filter, colorKey, IntPtr.Zero);
     }
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Loads a volume from a file in a strean.
 /// </summary>
 /// <param name="volume">The volume.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="filter">The filter.</param>
 /// <param name="colorKey">The color key.</param>
 /// <param name="sourceBox">The source box.</param>
 /// <param name="destinationBox">The destination box.</param>
 /// <returns>
 /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
 /// </returns>
 /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
 public static void FromFileInStream(Volume volume, Stream stream, Filter filter, int colorKey, Box sourceBox, Box destinationBox)
 {
     unsafe
     {
         CreateFromFileInStream(volume, stream, filter, colorKey, new IntPtr(&sourceBox), new IntPtr(&destinationBox), null, IntPtr.Zero);
     }
 }
Ejemplo n.º 24
0
		protected static D3D9.Box ToD3DBoxExtent( PixelBox lockBox )
		{
			var pbox = new D3D9.Box();
			pbox.Left = 0;
			pbox.Right = lockBox.Width;
			pbox.Top = 0;
			pbox.Bottom = lockBox.Height;
			pbox.Front = 0;
			pbox.Back = lockBox.Depth;
			return pbox;
		}
Ejemplo n.º 25
0
        /// <summary>
        /// Loads a volume from a file in a strean.
        /// </summary>
        /// <param name="volume">The volume.</param>
        /// <param name="stream">The stream.</param>
        /// <param name="filter">The filter.</param>
        /// <param name="colorKey">The color key.</param>
        /// <param name="sourceBox">The source box.</param>
        /// <param name="destinationBox">The destination box.</param>
        /// <param name="imageInformation">The image information.</param>
        /// <returns>
        /// A <see cref="SharpDX.Result"/> object describing the result of the operation.
        /// </returns>
        /// <unmanaged>HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo)</unmanaged>
        public static void FromFileInStream(Volume volume, Stream stream, Filter filter, int colorKey, Box sourceBox, Box destinationBox, out ImageInformation imageInformation)
        {

            FromFileInStream(volume, stream, filter, colorKey, sourceBox, destinationBox, null, out imageInformation);
        }