Axiom.Media.Image.FromDynamicImage C# (CSharp) Метод

FromDynamicImage() публичный Метод

Loads raw image data from a byte array.
public FromDynamicImage ( byte buffer, int width, int height, PixelFormat format ) : Image
buffer byte Raw image buffer.
width int Width of this image data (in pixels).
height int Height of this image data (in pixels).
format PixelFormat Pixel format used in this texture.
Результат Image
		public Image FromDynamicImage( byte[] buffer, int width, int height, PixelFormat format )
		{
			return FromDynamicImage( buffer, width, height, 1, format );
		}

Same methods

Image::FromDynamicImage ( byte buffer, int width, int height, int depth, PixelFormat format ) : Image
Image::FromDynamicImage ( byte buffer, int width, int height, int depth, PixelFormat format, bool autoDelete, int numFaces, int numMipMaps ) : Image

Usage Example

Пример #1
0
        private void SaveToDisk( Texture tp, string filename )
        {
          // Declare buffer
            int buffSize = tp.Width * tp.Height * tp.Depth * 4;
            byte[] data = new byte[buffSize];
          

          // Setup Image with correct settings
          Image i = new Image();
          i.FromDynamicImage(data, tp.Width, tp.Height, tp.Depth,tp.Format);
          
          // Copy Texture buffer contents to image buffer
          HardwarePixelBuffer buf = tp.GetBuffer();      
          PixelBox destBox = i.GetPixelBox(0,0);
          buf.BlitToMemory(destBox);
          
          // Save to disk!
          i.Save( @"C:\" + filename );
        }
All Usage Examples Of Axiom.Media.Image::FromDynamicImage