本文整理汇总了C#中SharpDX.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.ToString方法的具体用法?C# SharpDX.ToString怎么用?C# SharpDX.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX
的用法示例。
在下文中一共展示了SharpDX.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FormatInfo
public static IFormatInfo FormatInfo(SharpDX.DXGI.Format dxgiFormat)
{
int numColors;
int colorBits;
FormatElementType colorFormatType;
int alphaBits;
FormatElementType alphaFormatType;
int totalBits;
ColorAlphaFormatFlags flags;
Utility.Helpers.FormatHelper.GetExplicitColorAlphaFormatInfo((ExplicitFormat)dxgiFormat,
out numColors, out colorBits, out colorFormatType, out alphaBits, out alphaFormatType, out totalBits, out flags);
return new FormatInfo
{
ID = (int)dxgiFormat,
Description = dxgiFormat.ToString(),
ExplicitFormat = (ExplicitFormat)dxgiFormat,
NumColors = numColors,
ColorBits = colorBits,
ColorFormatType = colorFormatType,
AlphaBits = alphaBits,
AlphaFormatType = alphaFormatType,
TotalBits = totalBits,
Flags = flags
};
}
示例2: GamepadCls
/// <summary>
/// ctor and init
/// </summary>
/// <param name="device">A DXInput device</param>
/// <param name="hwnd">The WinHandle of the main window</param>
/// <param name="panel">The respective JS panel to show the properties</param>
public GamepadCls( SharpDX.XInput.Controller device, UC_GpadPanel panel, int tabIndex )
{
log.DebugFormat( "GamepadCls ctor - Entry with index {0}", device.ToString( ) );
m_device = device;
m_gPanel = panel;
MyTabPageIndex = tabIndex;
Activated = false;
m_senseLimit = AppConfiguration.AppConfig.gpSenseLimit; // can be changed in the app.config file if it is still too little
// Set BufferSize in order to use buffered data.
log.Debug( "Get GP Objects" );
try {
m_gpCaps = m_device.GetCapabilities( DeviceQueryType.Gamepad );
}
catch ( Exception ex ) {
log.Error( "Get GamepadCapabilities failed", ex );
}
m_gPanel.Caption = DevName;
int n = 0;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadDown ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadLeft ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadRight ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.DPadUp ) ) n++;
m_gPanel.nDPads = n.ToString( );
m_gPanel.DPadE = ( n > 0 );
n = 0;
if ( ( m_gpCaps.Gamepad.LeftThumbX != 0 ) || ( m_gpCaps.Gamepad.LeftThumbY != 0 ) || Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.LeftThumb ) ) { n++; m_gPanel.TStickLE = true; }
if ( ( m_gpCaps.Gamepad.RightThumbX != 0 ) || ( m_gpCaps.Gamepad.RightThumbY != 0 ) || Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.RightThumb ) ) { n++; m_gPanel.TStickRE = true; }
m_gPanel.nTSticks = n.ToString( );
n = 0;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.A ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.B ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.X ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Y ) ) n++;
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Start ) ) { n++; m_gPanel.StartE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.Back ) ) { n++; m_gPanel.BackE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.LeftShoulder ) ) { n++; m_gPanel.ShoulderLE = true; }
if ( Bit( m_gpCaps.Gamepad.Buttons, GamepadButtonFlags.RightShoulder ) ) { n++; m_gPanel.ShoulderRE = true; }
m_gPanel.nButtons = n.ToString( );
n = 0;
if ( m_gpCaps.Gamepad.LeftTrigger > 0 ) { n++; m_gPanel.TriggerLE = true; }
if ( m_gpCaps.Gamepad.RightTrigger > 0 ) { n++; m_gPanel.TriggerRE = true; }
m_gPanel.nTriggers = n.ToString( );
m_gPanel.ButtonE = true; // what else ...
ApplySettings( ); // get whatever is needed here from Settings
Activated = true;
}
示例3: FromFourCC
/// <summary>
/// Returns a standard Media foundation GUID format from a FourCC input
/// </summary>
/// <param name="fourCC">FourCC input</param>
/// <returns>Media foundation unique ID</returns>
public static Guid FromFourCC(SharpDX.Multimedia.FourCC fourCC)
{
return new Guid(string.Concat(fourCC.ToString(), "-0000-0010-8000-00aa00389b71"));
}