/// <summary> /// Gets the directX pixelformat for the specified pixelformat /// </summary> /// <param name="e">ePixelFormat</param> /// <returns>DirectX PixelFormat</returns> public static PixelFormat GetPixelFormat(ePixelFormat e) { PixelFormat pixelFormat = new PixelFormat(); switch (e) { case ePixelFormat.RGB32: pixelFormat.Rgb = true; pixelFormat.RgbBitCount = 32; pixelFormat.RBitMask = 0xFF0000; pixelFormat.GBitMask = 0x00FF00; pixelFormat.BBitMask = 0x0000FF; break; case ePixelFormat.YUY2: pixelFormat.FourCC = 0x32595559; pixelFormat.FourCcIsValid = true; break; } return pixelFormat; }
/// <summary> /// Gets the directX pixelformat for the specified pixelformat /// </summary> /// <param name="e">ePixelFormat</param> /// <returns>DirectX PixelFormat</returns> public static Microsoft.DirectX.DirectDraw.PixelFormat GetPixelFormat(EPixelFormat e) { Microsoft.DirectX.DirectDraw.PixelFormat pixelFormat = new Microsoft.DirectX.DirectDraw.PixelFormat(); switch (e) { case EPixelFormat.RGB32: pixelFormat.Rgb = true; pixelFormat.RgbBitCount = 32; pixelFormat.RBitMask = 0xFF0000; pixelFormat.GBitMask = 0x00FF00; pixelFormat.BBitMask = 0x0000FF; break; case EPixelFormat.YUY2: pixelFormat.FourCC = 0x32595559; pixelFormat.FourCcIsValid = true; break; } return(pixelFormat); }
/// <summary> /// Gets the directX pixelformat for the specified pixelformat /// </summary> /// <param name="e">ePixelFormat</param> /// <returns>DirectX PixelFormat</returns> public static Microsoft.DirectX.DirectDraw.PixelFormat GetPixelFormat( EPixelFormat e ) { Microsoft.DirectX.DirectDraw.PixelFormat pixelFormat = new Microsoft.DirectX.DirectDraw.PixelFormat(); switch( e ) { case EPixelFormat.RGB32: pixelFormat.Rgb = true; pixelFormat.RgbBitCount = 32; pixelFormat.RBitMask = 0xFF0000; pixelFormat.GBitMask = 0x00FF00; pixelFormat.BBitMask = 0x0000FF; break; case EPixelFormat.YUY2: pixelFormat.FourCC = 0x32595559; pixelFormat.FourCcIsValid = true; break; } return pixelFormat; }