当前位置: 首页>>代码示例>>C#>>正文


C# Factory.CreateDCRenderTarget方法代码示例

本文整理汇总了C#中Factory.CreateDCRenderTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Factory.CreateDCRenderTarget方法的具体用法?C# Factory.CreateDCRenderTarget怎么用?C# Factory.CreateDCRenderTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Factory的用法示例。


在下文中一共展示了Factory.CreateDCRenderTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeviceContextRenderTarget

 /// <summary>	
 /// Creates a render target that draws to a Windows Graphics Device Interface (GDI) device context.	
 /// </summary>	
 /// <remarks>	
 /// Before you can render with a DC render target, you must use the render target's {{BindDC}} method to associate it with a GDI DC.  Do this for each different DC and whenever there is a change in the size of the area you want to draw to.To enable the DC render target to work with GDI, set the render target's DXGI format to <see cref="SharpDX.DXGI.Format.B8G8R8A8_UNorm"/> and alpha mode to <see cref="SharpDX.Direct2D1.AlphaMode.Premultiplied"/> or D2D1_ALPHA_MODE_IGNORE.Your application should create render targets once and hold on to them for the life of the application or until the render target's  {{EndDraw}} method returns the {{D2DERR_RECREATE_TARGET}} error. When you receive this error, recreate the render target (and any resources it created).	
 /// </remarks>	
 /// <param name="factory">an instance of <see cref = "SharpDX.Direct2D1.Factory" /></param>
 /// <param name="properties">The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering.  To enable the device context (DC) render target to work with GDI, set the DXGI format to <see cref="SharpDX.DXGI.Format.B8G8R8A8_UNorm"/> and the alpha mode to <see cref="SharpDX.Direct2D1.AlphaMode.Premultiplied"/> or D2D1_ALPHA_MODE_IGNORE. For more information about pixel formats, see  {{Supported Pixel  Formats and Alpha Modes}}.</param>
 public DeviceContextRenderTarget(Factory factory, RenderTargetProperties properties)
     : base(IntPtr.Zero)
 {
     factory.CreateDCRenderTarget(ref properties, this);
 }
开发者ID:numo16,项目名称:SharpDX,代码行数:13,代码来源:DeviceContextRenderTarget.cs


注:本文中的Factory.CreateDCRenderTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。